|
ProgramixGenericLib v5.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TagHandler
All information about the parsing of the XML document is passed to
TagHandler's by the SAXPlusProcessor
.
The processing flow:
startTag()
method is called first passing in the
name of the tag (TagHandlers don't necessarily know their own name).
text()
method is called for text (if any) within this
tag.text()
is never called.text()
will be called once for each block of (non-whitespace)
text found between the sub tags.startSubTag()
is
called to determine the TagHandler for the sub tag. When the sub
tag is complete, endSubTag()
is called.endTag()
is called. After
that, getResult()
may (or may not) be called.
All of these methods potentially throw SAXException
to indicate a
problem in processing the data. If a RuntimeException
is thrown
from any of these methods, it will be automatically wrapped in a
SAXException
and that wrapped exception will be throw by
SAXPlusProcessor
.
Method Summary | |
---|---|
void |
endSubTag(NameDetail subTagName,
Value subTagResult)
Called after a sub tag has completed. |
void |
endTag()
|
Value |
getResult()
Called after endTag() to retrieve the results of the
processing of this tag (and all of its sub tags). |
TagHandler |
startSubTag(NameDetail subTagName)
Returns the handler for the sub tag. |
void |
startTag(NameDetail tagName,
AttributeGroup attr)
|
void |
text(Value tagText)
Delivers textual content within this tag. |
Method Detail |
---|
void startTag(NameDetail tagName, AttributeGroup attr) throws SAXException
SAXException
void endTag() throws SAXException
SAXException
void text(Value tagText) throws SAXException
For example:
<apple> <excellent>Red Delicious</excellent> <good>Granny Smith</good> </apple> <fresh value="yes" /> <mango> </mango> <story>They are <bold>very</bold> tasty.</story>The text() method is called:
SAXException
TagHandler startSubTag(NameDetail subTagName) throws SAXException
SAXException
void endSubTag(NameDetail subTagName, Value subTagResult) throws SAXException
SAXException
Value getResult() throws SAXException
endTag()
to retrieve the results of the
processing of this tag (and all of its sub tags).
SAXException
- if the result can not be assembled (e.g. a
required piece of data is missing).
|
ProgramixGenericLib v5.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |