Class SimpleHandler
- java.lang.Object
-
- com.singularsys.extensions.mathml.parser.SimpleHandler
-
- All Implemented Interfaces:
TagHandler
public class SimpleHandler extends java.lang.Object implements TagHandler
A simple handler which converts all elements to a tree structure. The inner class TreeNode represents elements of the tree and the standard output format from the toString method is such that<math><apply><plus/><ci>x</ci><cn type="real">3</cn></apply></math>
becomesmath -apply --plus --ci ---x --cn {type=real} ---3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleHandler.TreeNode
A class used to represent the tree.
-
Constructor Summary
Constructors Constructor Description SimpleHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
handle(StackFrame frame, org.xml.sax.Locator loc)
Transform the element, called when a closing tag is encountered.
-
-
-
Method Detail
-
handle
public java.lang.Object handle(StackFrame frame, org.xml.sax.Locator loc) throws org.xml.sax.SAXParseException
Description copied from interface:TagHandler
Transform the element, called when a closing tag is encountered.- Specified by:
handle
in interfaceTagHandler
- Parameters:
frame
- StackFrame representing the elementloc
- 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:
org.xml.sax.SAXParseException
-
-