Skip navigation links

Oracle® Database XML Java API Reference
12c Release 1 (12.1)

E15981-09


oracle.xml.xquery
Interface OXQJavaResolverFactory

All Superinterfaces:
OXQEntityResolverFactory

public interface OXQJavaResolverFactory
extends OXQEntityResolverFactory

The factory interface for creating entity resolvers for external functions implemented in Java.

The entity resolver created by this factory responds to the following entity kind requests: OXQEntityKind.EXTERNAL_FUNCTION and OXQEntityKind.MODULE.

1. The entity resolver will respond to an OXQEntityKind.EXTERNAL_FUNCTION request by returning a Java Class or Method based on the option declaration OPTION_BINDING. OPTION_BINDING must be set to a value of the form package.Class#method(Type1,Type2,...), where

Examples:

  (: using a Java Class that extends OXQFunctionEvaluator :)
  declare option ora-java:binding = "example.MyFunctionImpl";
  declare function local:my-fn() as xs:int external;

  (: using static Java Method with complete "ora-java:binding" value :)
  declare option ora-java:binding = "java.lang.Math#min(int,int)";
  declare function local:my-min($x as xs:int, $y as xs:int) as xs:int external;

  (: implicit parameter types :)
  declare option ora-java:binding = "java.lang.Math#min";
  declare function local:my-min($x as xs:int, $y as xs:int) as xs:int external;

  (: implicit method name and parameter types :)
  declare option ora-java:binding = "java.lang.Math";
  declare function local:min($x as xs:int, $y as xs:int) as xs:int external;
  

2. The entity resolver will also respond to a OXQEntityKind.MODULE request with a namespace in the form java:package.Class, where package.Class is a fully qualified name of a Java class to be imported as an XQuery module.

Example:

  import module math = "java:java.lang.Math";
  math:max(1, 2)
  
Since:
12.1

Field Summary
static javax.xml.namespace.QName OPTION_BINDING
          Name of the option that specifies the Java binding.

 

Method Summary
 java.lang.ClassLoader getClassLoader()
          Returns the class loader that will be used for loading Java classes by this resolver.
 void setClassLoader(java.lang.ClassLoader classLoader)
          Assigns the class loader to be used for loading Java classes.

 

Methods inherited from interface oracle.xml.xquery.OXQEntityResolverFactory
createResolver

 

Field Detail

OPTION_BINDING

static final javax.xml.namespace.QName OPTION_BINDING
Name of the option that specifies the Java binding. See this class' documentation for more details.

Method Detail

setClassLoader

void setClassLoader(java.lang.ClassLoader classLoader)
Assigns the class loader to be used for loading Java classes. By default the class loader that loaded OXQJavaResolverFactory is used.
Parameters:
classLoader - class loader instance. Cannot be null

getClassLoader

java.lang.ClassLoader getClassLoader()
Returns the class loader that will be used for loading Java classes by this resolver.
Returns:
class loader

Skip navigation links

Oracle® Database XML Java API Reference
12c Release 1 (12.1)

E15981-09


Copyright © 2003, 2014, Oracle and/or its affiliates. All rights reserved.