org.apache.xalan.extensions

Class ExtensionHandlerExsltFunction


public class ExtensionHandlerExsltFunction
extends ExtensionHandler

Execute EXSLT functions, determine the availability of EXSLT functions, and the availability of an EXSLT result element.

Constructor Summary

ExtensionHandlerExsltFunction(String ns, StylesheetRoot stylesheet)
Constructor called from ElemExsltFunction runtimeInit().

Method Summary

Object
callFunction(String funcName, Vector args, Object methodKey, ExpressionContext exprContext)
Execute the EXSLT function and return the result value.
Object
callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext)
Execute the EXSLT function and return the result value.
ElemExsltFunction
getFunction(String funcName)
Get the ElemExsltFunction element associated with the function.
boolean
isElementAvailable(String elemName)
If an element-available() call applies to an EXSLT result element within an EXSLT function element, return true.
boolean
isFunctionAvailable(String funcName)
Does the EXSLT function exist?
void
processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey)
Required by ExtensionHandler (an abstract method).

Methods inherited from class org.apache.xalan.extensions.ExtensionHandler

callFunction, callFunction, isElementAvailable, isFunctionAvailable, processElement

Constructor Details

ExtensionHandlerExsltFunction

public ExtensionHandlerExsltFunction(String ns,
                                     StylesheetRoot stylesheet)
Constructor called from ElemExsltFunction runtimeInit().

Method Details

callFunction

public Object callFunction(String funcName,
                           Vector args,
                           Object methodKey,
                           ExpressionContext exprContext)
            throws TransformerException
Execute the EXSLT function and return the result value.
Overrides:
callFunction in interface ExtensionHandler
Parameters:
funcName - Name of the EXSLT function.
args - The arguments of the function call.
methodKey - Not used.
exprContext - Used to get the XPathContext.
Returns:
the return value of the function evaluation.

callFunction

public Object callFunction(FuncExtFunction extFunction,
                           Vector args,
                           ExpressionContext exprContext)
            throws TransformerException
Execute the EXSLT function and return the result value.
Overrides:
callFunction in interface ExtensionHandler
Parameters:
extFunction - The XPath extension function
args - The arguments of the function call.
exprContext - The context in which this expression is being executed.
Returns:
the return value of the function evaluation.

getFunction

public ElemExsltFunction getFunction(String funcName)
Get the ElemExsltFunction element associated with the function.
Parameters:
funcName - Local name of the function.
Returns:
the ElemExsltFunction element associated with the function, null if none exists.

isElementAvailable

public boolean isElementAvailable(String elemName)
If an element-available() call applies to an EXSLT result element within an EXSLT function element, return true. Note: The EXSLT function element is a template-level element, and element-available() returns false for it.
Overrides:
isElementAvailable in interface ExtensionHandler
Parameters:
Returns:
true if the function is available.

isFunctionAvailable

public boolean isFunctionAvailable(String funcName)
Does the EXSLT function exist?
Overrides:
isFunctionAvailable in interface ExtensionHandler
Parameters:
funcName - Local name of the function.
Returns:
true if the function exists.

processElement

public void processElement(String localPart,
                           ElemTemplateElement element,
                           TransformerImpl transformer,
                           Stylesheet stylesheetTree,
                           Object methodKey)
            throws TransformerException,
                   IOException
Required by ExtensionHandler (an abstract method). No-op.
Overrides:
processElement in interface ExtensionHandler

Copyright B) 2004 Apache XML Project. All Rights Reserved.