|
Oracle® Database XML Java API Reference 12c Release 1 (12.1) E15981-09 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface OXQJavaResolverFactory
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
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.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)
| Field Summary | |
|---|---|
static javax.xml.namespace.QName |
OPTION_BINDINGName 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 |
|---|
static final javax.xml.namespace.QName OPTION_BINDING
| Method Detail |
|---|
void setClassLoader(java.lang.ClassLoader classLoader)
OXQJavaResolverFactory is used.classLoader - class loader instance. Cannot be nulljava.lang.ClassLoader getClassLoader()
|
Oracle® Database XML Java API Reference 12c Release 1 (12.1) E15981-09 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright © 2003, 2014, Oracle and/or its affiliates. All rights reserved.