jd.xml.xslt.extension
Class JavaExtensionHandler
java.lang.Object
jd.xml.xslt.extension.ExtensionHandler
jd.xml.xslt.extension.JavaExtensionHandler
- Direct Known Subclasses:
- JdExtensionHandler
- public class JavaExtensionHandler
- extends ExtensionHandler
An ExtensionHandler that maps extension functions to java methods.
It is defined by a script-element. For instance
>
allows expressions to use the methods of java.lang.Math:
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaExtensionHandler
public JavaExtensionHandler(String namespaceUri,
Class javaClass)
- Create a JavaExtensionHandler
- Parameters:
namespaceUri - the namespace uri of this ExtensionHandlerjavaClass - the extension functions handled by this ExtensionHandlers
are methods of this class
isElementAvailable
public boolean isElementAvailable(String name)
- Return if an extension element is available.
- Specified by:
isElementAvailable in class ExtensionHandler
isFunctionAvailable
public boolean isFunctionAvailable(String name)
- Return if the associated java class has a method with the given name
If true this does not guarantee that the method can be called successfully.
- Specified by:
isFunctionAvailable in class ExtensionHandler
- Parameters:
name - the method name. If it equals "new" it is tested whether the
class has a constructor.
getFunction
public Function getFunction(XsltContext context,
String methodName,
Expression[] arguments)
- Return an extension function for the given name.
- Specified by:
getFunction in class ExtensionHandler
- Parameters:
context - the current evaluation contextmethodName - a method namearguments - the arguments passed to the method