|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.program.tagvalue.SimpleTagValueWrapper
org.biojava.bio.program.tagvalue.TagDelegator
public class TagDelegator
Pushes a new parser and listener, or delegate to a listener depending on the tag.
setParserListener() is used to associate a tag with a TagValueParser and TagValueListener. When this tag is encountered, the pair will be pushed onto the parser processing stack and will gain control of the stream until that tag has ended. setListener() is used to associate a listener with a tag that will be used to handle those values without pushing a sub-context. The delegator is constructed with a default TagValueListener that will be informed of all events for which there are no explicit delegate pairs registered.
Constructor Summary | |
---|---|
TagDelegator()
|
|
TagDelegator(TagValueListener delegate)
|
Method Summary | |
---|---|
void |
endTag()
End the current tag. |
TagValueParser |
getDelegateParser()
|
TagValueListener |
getListener(java.lang.Object tag)
|
TagValueParser |
getParser(java.lang.Object tag)
|
java.util.Set |
getTags()
|
void |
setDelegateParser(TagValueParser delegateParser)
|
void |
setListener(java.lang.Object tag,
TagValueListener listener)
|
void |
setParserListener(java.lang.Object tag,
TagValueParser parser,
TagValueListener listener)
|
void |
startTag(java.lang.Object tag)
Start a new tag. |
void |
value(TagValueContext tvc,
java.lang.Object value)
A value has been seen. |
Methods inherited from class org.biojava.bio.program.tagvalue.SimpleTagValueWrapper |
---|
endRecord, getDelegate, setDelegate, startRecord |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TagDelegator()
public TagDelegator(TagValueListener delegate)
Method Detail |
---|
public void setDelegateParser(TagValueParser delegateParser)
public TagValueParser getDelegateParser()
public void startTag(java.lang.Object tag) throws ParserException
TagValueListener
startTag
in interface TagValueListener
startTag
in class SimpleTagValueWrapper
tag
- the Object representing the new tag
ParserException
- if the tag could not be startedpublic void endTag() throws ParserException
TagValueListener
endTag
in interface TagValueListener
endTag
in class SimpleTagValueWrapper
ParserException
- if the tag could not be endedpublic void value(TagValueContext tvc, java.lang.Object value) throws ParserException
TagValueListener
value
in interface TagValueListener
value
in class SimpleTagValueWrapper
tvc
- a TagValueContext that could be used to push a sub-documentvalue
- the value Object observed
ParserException
- if the value could not be processedpublic void setParserListener(java.lang.Object tag, TagValueParser parser, TagValueListener listener)
public void setListener(java.lang.Object tag, TagValueListener listener)
public TagValueParser getParser(java.lang.Object tag)
public TagValueListener getListener(java.lang.Object tag)
public java.util.Set getTags()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |