|
||||||||||
| 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(Object tag)
|
TagValueParser |
getParser(Object tag)
|
Set |
getTags()
|
void |
setDelegateParser(TagValueParser delegateParser)
|
void |
setListener(Object tag,
TagValueListener listener)
|
void |
setParserListener(Object tag,
TagValueParser parser,
TagValueListener listener)
|
void |
startTag(Object tag)
Start a new tag. |
void |
value(TagValueContext tvc,
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(Object tag)
throws ParserException
TagValueListener
startTag in interface TagValueListenerstartTag in class SimpleTagValueWrappertag - the Object representing the new tag
ParserException - if the tag could not be started
public void endTag()
throws ParserException
TagValueListener
endTag in interface TagValueListenerendTag in class SimpleTagValueWrapperParserException - if the tag could not be ended
public void value(TagValueContext tvc,
Object value)
throws ParserException
TagValueListener
value in interface TagValueListenervalue in class SimpleTagValueWrappertvc - a TagValueContext that could be used to push a sub-documentvalue - the value Object observed
ParserException - if the value could not be processed
public void setParserListener(Object tag,
TagValueParser parser,
TagValueListener listener)
public void setListener(Object tag,
TagValueListener listener)
public TagValueParser getParser(Object tag)
public TagValueListener getListener(Object tag)
public Set getTags()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||