Package org.jfree.xml.util
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
The SAX2 callback implementation used for parsing the model xml files.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSAXModelHandler
(URL resource, boolean isInclude) Creates a new SAX handler for parsing the model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
endElement
(String uri, String localName, String qName) Receive notification of the end of an element.private int
getState()
Returns the current state.private void
setState
(int state) Sets the current state.void
startElement
(String uri, String localName, String qName, Attributes attributes) Receive notification of the start of an element.private void
startObjectElement
(String qName, Attributes attributes) Handles the start of an element within an object definition.private void
startRootElement
(String qName, Attributes attributes) Handles the include or object tag.Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
resource
The resource URL. -
state
private int stateThe current state. -
openComments
Open comments. -
isInclude
private boolean isIncludeFlag to track includes.
-
-
Constructor Details
-
SAXModelHandler
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 interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- 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
Receive notification of the end of an element.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- 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 occuredObjectDescriptionException
- 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.
-