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 java.lang.Object implements TagHandler
Base class which provides access to Jep components- Author:
- Richard Morris
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionTable
ft
protected Jep
jep
protected NodeFactory
nf
protected NumberFactory
numf
protected OperatorTableI
ot
protected VariableTable
vt
-
Constructor Summary
Constructors Constructor Description AbstractHandler(Jep jep)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Node[]
convertChildrenToNodes(StackFrame frame, int start, org.xml.sax.Locator loc)
Converts the children of a StackFrame to an array of Nodes.protected Node
convertToNode(StackFrame frame, java.lang.Object arg, org.xml.sax.Locator loc)
Casts the argument to a Node.FunctionTable
getFt()
Jep
getJep()
NodeFactory
getNf()
NumberFactory
getNumf()
OperatorTableI
getOt()
protected Node[]
jepNodesAsArray(StackFrame frame, org.xml.sax.Locator loc)
Convert those children which are nodes to a list, other nodes are ignored.protected Node[]
jepNodesToFlatArray(StackFrame frame, org.xml.sax.Locator loc)
Convert those children which are nodes or arrays of nodes to a list.protected java.util.List<Node>
jepNodesToFlatList(StackFrame frame)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.singularsys.extensions.mathml.parser.TagHandler
handle
-
-
-
-
Field Detail
-
jep
protected Jep jep
-
nf
protected NodeFactory nf
-
ot
protected OperatorTableI ot
-
numf
protected NumberFactory numf
-
ft
protected FunctionTable ft
-
vt
protected VariableTable vt
-
-
Constructor Detail
-
AbstractHandler
public AbstractHandler(Jep jep)
-
-
Method Detail
-
convertToNode
protected Node convertToNode(StackFrame frame, java.lang.Object arg, org.xml.sax.Locator loc) throws org.xml.sax.SAXParseException
Casts the argument to a Node.- Parameters:
frame
- TODOarg
- the argumentloc
-- Returns:
- the argument cast as a Node.
- Throws:
org.xml.sax.SAXParseException
- if the argument is not a Node
-
convertChildrenToNodes
protected Node[] convertChildrenToNodes(StackFrame frame, int start, org.xml.sax.Locator loc) throws org.xml.sax.SAXParseException
Converts the children of a StackFrame to an array of Nodes.- Parameters:
frame
- the StackFramestart
- the first child to convertloc
-- Returns:
- an array of size (frame.getNumChildren - start)
- Throws:
org.xml.sax.SAXParseException
- if any of the arguments are not nodes
-
jepNodesAsArray
protected Node[] jepNodesAsArray(StackFrame frame, org.xml.sax.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, org.xml.sax.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 java.util.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()
-
-