Package org.biojava.bio.program.tagvalue
Class TagDelegator
java.lang.Object
org.biojava.bio.program.tagvalue.SimpleTagValueWrapper
org.biojava.bio.program.tagvalue.TagDelegator
- All Implemented Interfaces:
TagValueListener,TagValueWrapper
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.
- Since:
- 1.2
- Author:
- Matthew Pocock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendTag()End the current tag.getListener(Object tag) getTags()voidsetDelegateParser(TagValueParser delegateParser) voidsetListener(Object tag, TagValueListener listener) voidsetParserListener(Object tag, TagValueParser parser, TagValueListener listener) voidStart a new tag.voidvalue(TagValueContext tvc, Object value) A value has been seen.Methods inherited from class org.biojava.bio.program.tagvalue.SimpleTagValueWrapper
endRecord, getDelegate, setDelegate, startRecord
-
Constructor Details
-
TagDelegator
public TagDelegator() -
TagDelegator
-
-
Method Details
-
setDelegateParser
-
getDelegateParser
-
startTag
Description copied from interface:TagValueListenerStart a new tag.- Specified by:
startTagin interfaceTagValueListener- Overrides:
startTagin classSimpleTagValueWrapper- Parameters:
tag- the Object representing the new tag- Throws:
ParserException- if the tag could not be started
-
endTag
Description copied from interface:TagValueListenerEnd the current tag.- Specified by:
endTagin interfaceTagValueListener- Overrides:
endTagin classSimpleTagValueWrapper- Throws:
ParserException- if the tag could not be ended
-
value
Description copied from interface:TagValueListenerA value has been seen.- Specified by:
valuein interfaceTagValueListener- Overrides:
valuein classSimpleTagValueWrapper- Parameters:
tvc- a TagValueContext that could be used to push a sub-documentvalue- the value Object observed- Throws:
ParserException- if the value could not be processed
-
setParserListener
-
setListener
-
getParser
-
getListener
-
getTags
-