public interface OXQJavaResolverFactory extends OXQEntityResolverFactory
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
package.Class is a fully qualified name of a Java Class which either extends OXQFunctionEvaluator, or contains a static Java Method which will be mapped to this function.method Optional: name of a static method in the specified Java Class. If not specified then the XQuery function's local name is used.Type1,Type2,... Optional: parameter types of the Java Method. If not specified then a mapping from XQuery parameters is used.(: 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.
import module math = "java:java.lang.Math"; math:max(1, 2)
| Modifier and Type | Field and Description |
|---|---|
static javax.xml.namespace.QName |
OPTION_BINDING
Name of the option that specifies the Java binding.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
createResolverstatic final javax.xml.namespace.QName OPTION_BINDING
void setClassLoader(java.lang.ClassLoader classLoader)
OXQJavaResolverFactory is used.classLoader - class loader instance. Cannot be nulljava.lang.ClassLoader getClassLoader()