org.inria.ns.reflex.processor.asl
Class ElementFunction

java.lang.Object
  extended by org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
      extended by org.inria.ns.reflex.processor.asl.ElementFunction
All Implemented Interfaces:
XPathFunction
Direct Known Subclasses:
DocumentFunction

public class ElementFunction
extends XPathFunction.NamedXPathFunction
implements XPathFunction

The asl:element() function returns the element that hosts the content and attributes to check.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
XPathFunction.NamedXPathFunction
 
Constructor Summary
ElementFunction()
           
 
Method Summary
 Object evaluate(XPathContext context, List args)
          Perform the function.
static Element getHostElement(XPathContext context)
          Return the element that hosts the content and attributes to check.
 
Methods inherited from class org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
getQName, setQName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
getQName
 

Constructor Detail

ElementFunction

public ElementFunction()
Method Detail

evaluate

public Object evaluate(XPathContext context,
                       List args)
                throws XPathFunctionException
Perform the function.

Specified by:
evaluate in interface XPathFunction
Parameters:
context - The context of the function.
args - The list of arguments of this function.
Returns:
The result of the evaluation.
Throws:
XPathFunctionException - When this function fails to be evaluated.

getHostElement

public static Element getHostElement(XPathContext context)
                              throws XPathFunctionException
Return the element that hosts the content and attributes to check.

Parameters:
context - The context.
Returns:
The host element.
Throws:
XPathFunctionException - If the schema client handler can't be retrieved.