Class AbstractModelReader.SAXModelHandler

java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jfree.xml.util.AbstractModelReader.SAXModelHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Enclosing class:
AbstractModelReader

private class AbstractModelReader.SAXModelHandler extends DefaultHandler
The SAX2 callback implementation used for parsing the model xml files.
  • Field Details

    • resource

      private URL resource
      The resource URL.
    • state

      private int state
      The current state.
    • openComments

      private Stack openComments
      Open comments.
    • isInclude

      private boolean isInclude
      Flag to track includes.
  • Constructor Details

    • SAXModelHandler

      public SAXModelHandler(URL resource, boolean isInclude)
      Creates a new SAX handler for parsing the model.
      Parameters:
      resource - the resource URL.
      isInclude - an include?
  • Method Details

    • startElement

      public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
      Receive notification of the start of an element.
      Specified by:
      startElement in interface ContentHandler
      Overrides:
      startElement in class DefaultHandler
      Parameters:
      uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
      localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
      qName - The qualified name (with prefix), or the empty string if qualified names are not available.
      attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
      Throws:
      SAXException - Any SAX exception, possibly wrapping another exception.
      See Also:
    • endElement

      public void endElement(String uri, String localName, String qName) throws SAXException
      Receive notification of the end of an element.
      Specified by:
      endElement in interface ContentHandler
      Overrides:
      endElement in class DefaultHandler
      Parameters:
      uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
      localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
      qName - The qualified name (with prefix), or the empty string if qualified names are not available.
      Throws:
      SAXException - Any SAX exception, possibly wrapping another exception.
      See Also:
    • startObjectElement

      private void startObjectElement(String qName, Attributes attributes) throws ObjectDescriptionException
      Handles the start of an element within an object definition.
      Parameters:
      qName - The qualified name (with prefix), or the empty string if qualified names are not available.
      attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
      Throws:
      ObjectDescriptionException - if an error occured while handling this tag
    • startRootElement

      private void startRootElement(String qName, Attributes attributes) throws SAXException, ObjectDescriptionException
      Handles the include or object tag.
      Parameters:
      qName - The qualified name (with prefix), or the empty string if qualified names are not available.
      attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
      Throws:
      SAXException - if an parser error occured
      ObjectDescriptionException - if an object model related error occured.
    • getState

      private int getState()
      Returns the current state.
      Returns:
      the state.
    • setState

      private void setState(int state)
      Sets the current state.
      Parameters:
      state - the state.