private class AbstractModelReader.SAXModelHandler
extends org.xml.sax.helpers.DefaultHandler
Modifier and Type | Field and Description |
---|---|
private boolean |
isInclude
Flag to track includes.
|
private java.util.Stack |
openComments
Open comments.
|
private java.net.URL |
resource
The resource URL.
|
private int |
state
The current state.
|
Constructor and Description |
---|
SAXModelHandler(java.net.URL resource,
boolean isInclude)
Creates a new SAX handler for parsing the model.
|
Modifier and Type | Method and Description |
---|---|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.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(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Receive notification of the start of an element.
|
private void |
startObjectElement(java.lang.String qName,
org.xml.sax.Attributes attributes)
Handles the start of an element within an object definition.
|
private void |
startRootElement(java.lang.String qName,
org.xml.sax.Attributes attributes)
Handles the include or object tag.
|
private java.net.URL resource
private int state
private java.util.Stack openComments
private boolean isInclude
public SAXModelHandler(java.net.URL resource, boolean isInclude)
resource
- the resource URL.isInclude
- an include?public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
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.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
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.org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
private void startObjectElement(java.lang.String qName, org.xml.sax.Attributes attributes) throws ObjectDescriptionException
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.ObjectDescriptionException
- if an error occured while
handling this tagprivate void startRootElement(java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException, ObjectDescriptionException
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.org.xml.sax.SAXException
- if an parser error occuredObjectDescriptionException
- if an object model related
error occured.private int getState()
private void setState(int state)
state
- the state.