java.lang.Object | ||
↳ | org.xml.sax.helpers.DefaultHandler | |
↳ | com.microstrategy.utils.xml.AbstractHandler |
A base class for content handlers
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected StringBuffer | buf |
This field is deprecated.
use getText() to acquire String of internal buffer
|
|||||||||
protected int | depth | The element depth count. | |||||||||
protected SAXSupport | parser | A reference to the SAX parser to which the handler is attached |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractHandler()
Default constructor.
| |||||||||||
AbstractHandler(SAXSupport pParser)
Initializes the handler and attaches it to the parser.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | characters(char[] ch, int start, int length) | ||||||||||
void | clearText() | ||||||||||
void |
endDocument()
This is a safegurd against forgetting to pop out inner handlers.
| ||||||||||
void |
endElement(String uri, String local, String qName)
The default implementation that calls
doEndElement
then reduces the depth count. | ||||||||||
float | getFloatValue() | ||||||||||
int | getIntValue() | ||||||||||
String | getText() | ||||||||||
void |
startElement(String uri, String local, String qName, Attributes attrs)
The default implementation that simply increases the depth count.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
doEndElement(String uri, String local, String qName)
Override this method insted of
endElement
to process end element event. | ||||||||||
void |
doStartElement(String uri, String local, String qName, Attributes attrs)
Override this method insted of
startElement
to process start element event. | ||||||||||
void | doStartElement(String uri, String local, String qName, AttributesXt attrsXt) | ||||||||||
void | popContentHandler(String uri, String local, String qName) | ||||||||||
void | setLogErrors(boolean value) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
This field is deprecated.
use getText()
to acquire String of internal buffer
A buffer to accumulate element text.
The element depth count. It is relative to the handler's root element, an element at which this handler was attached to the parser. Whenever a handler receives the startElement event it increases this counter. Whenever the handler receives the endElement event it decreases the counter. When the counter becomes zero the handler pops itself from the handler stack. Real handler shall use this variable to optimize content handlers. They shall first check the depth and then check for tag names that are expected at this depth.
Default constructor.
Initializes the handler and attaches it to the parser.
pParser | - a SAX parser to which this handler needs to be attached |
---|
ch | The characters. |
---|---|
start | The start position in the character array. |
length | The number of characters to use from the character array. |
SAXException | Any SAX exception, possibly wrapping another exception. |
---|
This is a safegurd against forgetting to pop out inner handlers. It throws an exception when end document event happens for inner handlers.
IllegalStateException | when called for inner handler |
---|---|
SAXException | Any SAX exception, possibly wrapping another exception. |
The default implementation that calls doEndElement
then reduces the depth count. If this is an event for the
handler's root element (depth count goes to zero), then the handlers is
detached from (popped out of) the parser.
Override the doEndElement
method insted of this
one to process end element event. This way you will not have problems with
depth counter while subclassing your event handlers.
When overriding this method always call super at the end
of your code.
uri | The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. |
---|---|
local | 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. |
SAXException | Any SAX exception, possibly wrapping another exception |
---|
The default implementation that simply increases the depth count. and then calls
doStartElement
method. Override the doStartElement method insted of this
one to process start element event. This way you will not have problems with
depth counter while subclassing your event handlers.
When overriding this method you shall either call supper
or simply
start your code with depth++;
statement (which is faster).
uri | The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed. |
---|---|
local | 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. |
attrs | The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object |
SAXException | Any SAX exception, possibly wrapping another exception |
---|
Override this method insted of endElement
to process end element event. This way you will not have problems with
depth counter while subclassing your event handlers.
SAXException | Any SAX exception, possibly wrapping another exception |
---|---|
Exception |
Override this method insted of startElement
to process start element event. This way you will not have problems with
depth counter while subclassing your event handlers.
SAXException | Any SAX exception, possibly wrapping another exception |
---|---|
Exception |
Exception |
---|
SAXException |
---|