|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jgb.handlers.swing.AbstractTagHandler
Default implementation for TagHandler
.
This default implementation does not allow subclasses to override
startElement(String, Map, Map)
or endElement(String, Map)
. It provides equivalent
methods in the form of enterElement(Map)
and exitElement()
.
This class also provides many helpful methods:
getObject(String)
and
putObject(String, Object)
TagHandler.OBJECTS_MAP_KEY
pushCurrentObject(String, Object)
and popCurrentObject()
TagHandler.CURRENT_OBJECTS_STACK_KEY
CurrentObjectsStackManager
- Manage a stack of objects
Field Summary | |
protected static String |
ATTR_CLASS
The name of the class attribute. |
protected static String |
ATTR_ID
The name of the id attribute. |
protected static String |
ATTR_REFID
The name of the refid attribute. |
protected Map |
tagContext
|
protected String |
tagName
|
Constructor Summary | |
AbstractTagHandler()
|
Method Summary | |
void |
endElement(String qName,
Map tagContext)
Signals the end of an element in the XML source. |
protected abstract void |
enterElement(Map atts)
Actually handle the element's behaviour when the element's start is encountered. |
protected abstract void |
exitElement()
Actually handle the element's behaviour when the element's closure is encountered. |
protected Object |
getCurrentObject()
|
protected String |
getCurrentObjectId()
|
protected Object |
getObject(String id)
|
protected boolean |
isCurrentObjectValid()
|
protected void |
popCurrentObject()
|
protected void |
pushCurrentObject(Object o)
|
protected void |
pushCurrentObject(String id,
Object o)
Pushes the passed object and id to the current objects stack. |
protected void |
putComponent(String id,
Component component)
|
protected void |
putObject(String id,
Object value)
|
void |
startElement(String qName,
Map tagContext,
Map atts)
Signals the start of a new element in the XML source. |
protected void |
throwParsingException(Exception cause)
|
protected void |
throwParsingException(String msg)
|
protected void |
throwParsingException(String msg,
Exception cause)
Throw a SAXException or a subclass if a locator is
available. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String ATTR_ID
protected static final String ATTR_CLASS
protected static final String ATTR_REFID
protected String tagName
protected Map tagContext
Constructor Detail |
public AbstractTagHandler()
Method Detail |
public final void startElement(String qName, Map tagContext, Map atts) throws org.xml.sax.SAXException
TagHandler
The Builder
object will call this method
whenever it encounters a new element.
startElement
in interface TagHandler
qName
- The qualified name of the element as it was encountered.tagContext
- A map of context information that is kept accross
all calls to TagHandler
s.atts
- A map of the attributes that were passed to this element.
org.xml.sax.SAXException
public final void endElement(String qName, Map tagContext) throws org.xml.sax.SAXException
TagHandler
The Builder
object will call this method
whenever an element ends.
endElement
in interface TagHandler
qName
- The qualified name of the element as it was encountered.tagContext
- A map of context information that is kept accross
all calls to TagHandler
s.
org.xml.sax.SAXException
protected Object getObject(String id)
protected void putComponent(String id, Component component)
protected void putObject(String id, Object value)
protected void pushCurrentObject(Object o)
protected void pushCurrentObject(String id, Object o)
protected void popCurrentObject()
protected Object getCurrentObject()
protected String getCurrentObjectId()
protected boolean isCurrentObjectValid()
protected void throwParsingException(String msg) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void throwParsingException(Exception cause) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void throwParsingException(String msg, Exception cause) throws org.xml.sax.SAXException
SAXException
or a subclass if a locator is
available.
org.xml.sax.SAXException
protected abstract void enterElement(Map atts) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected abstract void exitElement() throws org.xml.sax.SAXException
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |