Class AbstractHandler

java.lang.Object
com.singularsys.extensions.mathml.parser.AbstractHandler
All Implemented Interfaces:
TagHandler
Direct Known Subclasses:
AnnotationHandler, ApplyHandler, ConstantHandler, DeclareHandler, FnHandler, IdentifierHandler, MathTagHandler, MatrixHandler, NumericConstantHandler, SemanticHandler

public abstract class AbstractHandler extends Object implements TagHandler
Base class which provides access to Jep components
Author:
Richard Morris
  • Field Details

  • Constructor Details

    • AbstractHandler

      public AbstractHandler(Jep jep)
  • Method Details

    • convertToNode

      protected Node convertToNode(StackFrame frame, Object arg, Locator loc) throws SAXParseException
      Casts the argument to a Node.
      Parameters:
      frame -
      arg - the argument
      loc -
      Returns:
      the argument cast as a Node.
      Throws:
      SAXParseException - if the argument is not a Node
    • convertChildrenToNodes

      protected Node[] convertChildrenToNodes(StackFrame frame, int start, Locator loc) throws SAXParseException
      Converts the children of a StackFrame to an array of Nodes.
      Parameters:
      frame - the StackFrame
      start - the first child to convert
      loc -
      Returns:
      an array of size (frame.getNumChildren - start)
      Throws:
      SAXParseException - if any of the arguments are not nodes
    • jepNodesAsArray

      protected Node[] jepNodesAsArray(StackFrame frame, Locator loc)
      Convert those children which are nodes to a list, other nodes are ignored.
      Parameters:
      frame -
      loc -
      Returns:
      an array of nodes
    • jepNodesToFlatArray

      protected Node[] jepNodesToFlatArray(StackFrame frame, Locator loc)
      Convert those children which are nodes or arrays of nodes to a list.
      Parameters:
      frame -
      loc -
      Returns:
      an array of nodes
    • jepNodesToFlatList

      protected List<Node> jepNodesToFlatList(StackFrame frame)
    • getJep

      public Jep getJep()
    • getNf

      public NodeFactory getNf()
    • getOt

      public OperatorTableI getOt()
    • getNumf

      public NumberFactory getNumf()
    • getFt

      public FunctionTable getFt()