org.inria.ns.reflex.processor.exp
Class MacroFunction

java.lang.Object
  extended by org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
      extended by org.inria.ns.reflex.processor.exp.MacroFunction
All Implemented Interfaces:
XPathFunction

public class MacroFunction
extends XPathFunction.NamedXPathFunction
implements XPathFunction

At runtime, the MacroFunction defines a function backed by an inline implementation.

A macro function is registered when a module definition uses <exp:function> without the source attribute.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
XPathFunction.NamedXPathFunction
 
Constructor Summary
MacroFunction(AbstractAction actions)
          Creates a new macro function.
 
Method Summary
 Object evaluate(XPathContext context, List args)
          Evaluate the function.
 
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

MacroFunction

public MacroFunction(AbstractAction actions)
Creates a new macro function. The macro function unmarshals its subactions before creation. Unlike other actions, the macro action has no method named "unmarshal".

Parameters:
actions - The action container.
Method Detail

evaluate

public Object evaluate(XPathContext context,
                       List args)
                throws XPathFunctionException
Description copied from interface: XPathFunction
Evaluate the function.

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