Package org.biojava.bio.program.tagvalue
Class AbstractWrapper
- java.lang.Object
-
- org.biojava.bio.program.tagvalue.AbstractWrapper
-
- All Implemented Interfaces:
TagValueListener,TagValueWrapper
public class AbstractWrapper extends Object implements TagValueWrapper
An abstract TagValueWrapper that does nothing!
Useful for writing TagValueWrappers which only act on a subset of the events.
- Author:
- David Huen
-
-
Constructor Summary
Constructors Constructor Description AbstractWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendRecord()The current record has ended.voidendTag()End the current tag.TagValueListenergetDelegate()get listener to which all calls will be delegatedvoidsetDelegate(TagValueListener delegate)set listener to which all calls will be delegatedvoidstartRecord()A new record is about to start.voidstartTag(Object tag)Start a new tag.voidvalue(TagValueContext ctxt, Object value)A value has been seen.
-
-
-
Constructor Detail
-
AbstractWrapper
public AbstractWrapper()
-
-
Method Detail
-
setDelegate
public void setDelegate(TagValueListener delegate)
Description copied from interface:TagValueWrapperset listener to which all calls will be delegated- Specified by:
setDelegatein interfaceTagValueWrapper
-
getDelegate
public TagValueListener getDelegate()
Description copied from interface:TagValueWrapperget listener to which all calls will be delegated- Specified by:
getDelegatein interfaceTagValueWrapper
-
startRecord
public void startRecord() throws ParserException
Description copied from interface:TagValueListenerA new record is about to start.- Specified by:
startRecordin interfaceTagValueListener- Throws:
ParserException- if the record can not be started
-
startTag
public void startTag(Object tag) throws ParserException
Description copied from interface:TagValueListenerStart a new tag.- Specified by:
startTagin interfaceTagValueListener- Parameters:
tag- the Object representing the new tag- Throws:
ParserException- if the tag could not be started
-
endTag
public void endTag() throws ParserException
Description copied from interface:TagValueListenerEnd the current tag.- Specified by:
endTagin interfaceTagValueListener- Throws:
ParserException- if the tag could not be ended
-
endRecord
public void endRecord() throws ParserException
Description copied from interface:TagValueListenerThe current record has ended.- Specified by:
endRecordin interfaceTagValueListener- Throws:
ParserException- if the record can not be ended
-
value
public void value(TagValueContext ctxt, Object value) throws ParserException
Description copied from interface:TagValueListenerA value has been seen.- Specified by:
valuein interfaceTagValueListener- Parameters:
ctxt- a TagValueContext that could be used to push a sub-documentvalue- the value Object observed- Throws:
ParserException- if the value could not be processed
-
-