Package org.apache.xalan.extensions
Class ExtensionsTable
- java.lang.Object
-
- org.apache.xalan.extensions.ExtensionsTable
-
public class ExtensionsTable extends java.lang.ObjectClass holding a table registered extension namespace handlers
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Hashtablem_extensionFunctionNamespacesTable of extensions that may be called from the expression language via the call(name, ...) function.
-
Constructor Summary
Constructors Constructor Description ExtensionsTable(StylesheetRoot sroot)The constructor (called from TransformerImpl) registers the StylesheetRoot for the transformation and instantiates an ExtensionHandler for each extension namespace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtensionNamespace(java.lang.String uri, ExtensionHandler extNS)Register an extension namespace handler.booleanelementAvailable(java.lang.String ns, java.lang.String elemName)Execute the element-available() function.java.lang.ObjectextFunction(java.lang.String ns, java.lang.String funcName, java.util.Vector argVec, java.lang.Object methodKey, ExpressionContext exprContext)Handle an extension function.java.lang.ObjectextFunction(FuncExtFunction extFunction, java.util.Vector argVec, ExpressionContext exprContext)Handle an extension function.booleanfunctionAvailable(java.lang.String ns, java.lang.String funcName)Execute the function-available() function.ExtensionHandlerget(java.lang.String extns)Get an ExtensionHandler object that represents the given namespace.
-
-
-
Constructor Detail
-
ExtensionsTable
public ExtensionsTable(StylesheetRoot sroot) throws javax.xml.transform.TransformerException
The constructor (called from TransformerImpl) registers the StylesheetRoot for the transformation and instantiates an ExtensionHandler for each extension namespace.- Throws:
javax.xml.transform.TransformerException
-
-
Method Detail
-
get
public ExtensionHandler get(java.lang.String extns)
Get an ExtensionHandler object that represents the given namespace.- Parameters:
extns- A valid extension namespace.- Returns:
- ExtensionHandler object that represents the given namespace.
-
addExtensionNamespace
public void addExtensionNamespace(java.lang.String uri, ExtensionHandler extNS)Register an extension namespace handler. This handler provides functions for testing whether a function is known within the namespace and also for invoking the functions.- Parameters:
uri- the URI for the extension.extNS- the extension handler.
-
functionAvailable
public boolean functionAvailable(java.lang.String ns, java.lang.String funcName) throws javax.xml.transform.TransformerExceptionExecute the function-available() function.- Parameters:
ns- the URI of namespace in which the function is neededfuncName- the function name being tested- Returns:
- whether the given function is available or not.
- Throws:
javax.xml.transform.TransformerException
-
elementAvailable
public boolean elementAvailable(java.lang.String ns, java.lang.String elemName) throws javax.xml.transform.TransformerExceptionExecute the element-available() function.- Parameters:
ns- the URI of namespace in which the function is neededelemName- name of element being tested- Returns:
- whether the given element is available or not.
- Throws:
javax.xml.transform.TransformerException
-
extFunction
public java.lang.Object extFunction(java.lang.String ns, java.lang.String funcName, java.util.Vector argVec, java.lang.Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerExceptionHandle an extension function.- Parameters:
ns- the URI of namespace in which the function is neededfuncName- the function name being calledargVec- arguments to the function in a vectormethodKey- a unique key identifying this function instance in the stylesheetexprContext- a context which may be passed to an extension function and provides callback functions to access various areas in the environment- Returns:
- result of executing the function
- Throws:
javax.xml.transform.TransformerException
-
extFunction
public java.lang.Object extFunction(FuncExtFunction extFunction, java.util.Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException
Handle an extension function.- Parameters:
extFunction- the extension functionargVec- arguments to the function in a vectorexprContext- a context which may be passed to an extension function and provides callback functions to access various areas in the environment- Returns:
- result of executing the function
- Throws:
javax.xml.transform.TransformerException
-
-