|
Release Planner v1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rp.util.xml.XMLTagsDefault
A default implementation of XMLTag that uses arrays and hash maps, and re-cycles loaders.
Constructor Summary | |
protected |
XMLTagsDefault(int nTags)
Allocates storage in advance for the tag mapping data structures. |
Method Summary | |
protected void |
doneTags()
Called after all the tags have been registered with putTag. |
XMLLoader |
getLoader(int id)
Fetches an instance of a loader class (possibly recycled) for a given tag id. |
int |
idOf(java.lang.String tagName)
Returns the integer id of a tag given by its string name. |
java.lang.String |
nameOf(int id)
Returns the string name of a tag given by its integer id. |
protected void |
putTag(int tagId,
java.lang.String tagName,
java.lang.String loaderClassName)
Registers an association. |
void |
returnLoader(int id,
XMLLoader loader)
Inidicates that the client is done with this loader and it may be recycled. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected XMLTagsDefault(int nTags)
Method Detail |
protected void putTag(int tagId, java.lang.String tagName, java.lang.String loaderClassName)
tagId
- the integer id of an XML tag (used for efficiency in place of the name)tagName
- the unqualified string name of an XML tag as it appears in an XML fileloaderClassName
- the name of a loader class for XML elements with this tagdoneTags()
protected void doneTags()
putTag()
public int idOf(java.lang.String tagName) throws XMLTagNotFoundException
XMLTags
idOf
in interface XMLTags
tagName
- the string name of the tag whose id we are looking up
XMLTagNotFoundException
- when the name corresponds to no tagpublic java.lang.String nameOf(int id)
XMLTags
nameOf
in interface XMLTags
id
- the integer id of the tag we are looking up
public XMLLoader getLoader(int id) throws XMLTagNoLoaderException
XMLTags
getLoader
in interface XMLTags
id
- the integer id of the tag whose loader we are instantiating
XMLTagNoLoaderException
- when the loader class cannot be instantiated.public void returnLoader(int id, XMLLoader loader)
XMLTags
returnLoader
in interface XMLTags
id
- the id of the tag withi which this loader is associated.loader
- the loader object to be recycled
|
Release Planner v1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |