|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.saxplus.BaseTagHandler
public abstract class BaseTagHandler
Implements all methods of TagHandler and can serve as a class
to extend for your TagHandler's. In your subclass, just override
the methods that you are interested in.
BaseTagHandler also supports a name-handler mapping for
all of the sub-tags of a tag (see
setSubTagHandler(String, TagHandler) and
setSubTagHandler(NameDetail, TagHandler)).
Therefore, the implementation of startSubTag(NameDetail)
rarely needs to be overridden.
| Constructor Summary | |
|---|---|
protected |
BaseTagHandler()
|
| Method Summary | |
|---|---|
void |
endSubTag(NameDetail subTagName,
Value subTagResult)
Called after a sub tag has completed. |
void |
endTag()
|
Value |
getResult()
This implementation returns ValueFactory.NULL_INSTANCE. |
protected TagHandler |
getSubTagHandler(NameDetail tagName)
Pulls of the plain name (using NameDetail.getName()) and
calls getSubTagHandler(String). |
protected TagHandler |
getSubTagHandler(String tagName)
Returns the handler for the specified tag, or null if no handler is found for the name. |
protected void |
setSubTagHandler(NameDetail tagName,
TagHandler handler)
Pulls of the plain name (using NameDetail.getName()) and
calls setSubTagHandler(String, TagHandler). |
protected void |
setSubTagHandler(String tagName,
TagHandler handler)
|
TagHandler |
startSubTag(NameDetail subTagName)
This implementation returns whatever getSubTagHandler(NameDetail) finds for the specified sub tag. |
void |
startTag(NameDetail tagName,
AttributeGroup attr)
|
void |
text(Value tagText)
Delivers textual content within this tag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected BaseTagHandler()
| Method Detail |
|---|
protected void setSubTagHandler(String tagName,
TagHandler handler)
protected void setSubTagHandler(NameDetail tagName,
TagHandler handler)
NameDetail.getName()) and
calls setSubTagHandler(String, TagHandler).
protected TagHandler getSubTagHandler(String tagName)
protected TagHandler getSubTagHandler(NameDetail tagName)
NameDetail.getName()) and
calls getSubTagHandler(String).
public void startTag(NameDetail tagName,
AttributeGroup attr)
throws SAXException
startTag in interface TagHandlerSAXException
public void endTag()
throws SAXException
endTag in interface TagHandlerSAXException
public void text(Value tagText)
throws SAXException
TagHandlerFor 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:
text in interface TagHandlerSAXException
public TagHandler startSubTag(NameDetail subTagName)
throws SAXException
getSubTagHandler(NameDetail) finds for the specified sub tag.
If no sub tag handler is found, then null is returned,
indicating that the sub tag is ignored.
Overridden by subclasses as appropriate.
startSubTag in interface TagHandlerSAXException
public void endSubTag(NameDetail subTagName,
Value subTagResult)
throws SAXException
TagHandler
endSubTag in interface TagHandlerSAXException
public Value getResult()
throws SAXException
ValueFactory.NULL_INSTANCE. Overridden by subclasses as appropriate.
getResult in interface TagHandlerSAXException - 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 | |||||||||