public abstract class UserDefinedFunctionProvider
extends java.lang.Object
Through this class, several User Defined Functions can be made available to Daffodil via a single entry in the META-INF/services file.
UDF Providers must subclass this, and must initialize the userDefinedFunctionClasses array with all the UDF classes it is providing.
If the UDFs being provided have constructors with arguments, the provider subclass must also implement the createUserDefinedFunction to return an initialized function class object based on the supplied namespace and name.
Subclasses must also supply a src/META-INF/services/org.apache.daffodil.udf.UserDefinedFunctionProvider file in their JAVA project in order to be discoverable by Daffodil.
Constructor and Description |
---|
UserDefinedFunctionProvider() |
Modifier and Type | Method and Description |
---|---|
UserDefinedFunction |
createUserDefinedFunction(java.lang.String namespaceURI,
java.lang.String fName)
Finds and initializes User Defined Function class based on namespace and name
provided.
|
abstract java.lang.Class<?>[] |
getUserDefinedFunctionClasses()
Must be implemented to return the classes of the User Defined Function this
provider is aware of/providing
|
public abstract java.lang.Class<?>[] getUserDefinedFunctionClasses()
public UserDefinedFunction createUserDefinedFunction(java.lang.String namespaceURI, java.lang.String fName) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.ExceptionInInitializerError, java.lang.ReflectiveOperationException
namespaceURI
- XML namespace associated with schema function callfName
- function name called in schemajava.lang.SecurityException
- if security manager exists and disallows accessjava.lang.IllegalArgumentException
- if the UDF doesn't have a no-argument constructorjava.lang.ExceptionInInitializerError
- if there is an issue initializing the UDF objectjava.lang.ReflectiveOperationException
- if the UDF doesn't have a no-argument constructor or if there is an
issue initializing the UDF object