Class ApplyHandler

java.lang.Object
com.singularsys.extensions.mathml.parser.AbstractHandler
com.singularsys.extensions.mathml.parser.ApplyHandler
All Implemented Interfaces:
TagHandler

public class ApplyHandler extends AbstractHandler
Handles the <apply> container element. The first child node specifies a function or operator and the remaining child nodes are its arguments.

The default action for most operators and functions is to build an ASTOpNode/ASTFunNode from the function. Some functions require special behaviour and these should extend SpecialFunctionHandler implementing the apply method.

Author:
Richard Morris
  • Constructor Details

    • ApplyHandler

      public ApplyHandler(Jep jep)
      Parameters:
      jep -
  • Method Details

    • handle

      public Object handle(StackFrame frame, Locator loc) throws SAXParseException
      Returns a Node representing the operator or function applied to the arguments. The function is the first child of the node and subsequent children are its arguments. For operators this will be an ASTOpNode, for Functions an ASTFunNode For a SpecialFunctionHandler just call its apply method.
      Parameters:
      frame - StackFrame representing the element
      loc - location in input
      Returns:
      typically a Node, other types of objects may also be returned when the tag has a special meaning for its parent node.
      Throws:
      SAXParseException