Class 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>
    becomes
    math
     -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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleHandler

        public SimpleHandler()
    • 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 interface TagHandler
        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:
        org.xml.sax.SAXParseException