Package org.biojava.bio.program.tagvalue
Class StateMachine.SimpleStateListener
java.lang.Object
org.biojava.bio.program.tagvalue.StateMachine.SimpleStateListener
- All Implemented Interfaces:
TagValueListener
- Enclosing class:
- StateMachine
a basic listener for a State. It forwards all events to the
delegate for the StateMachine. Extend to implement listeners
for specific states.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe current record has ended.voidendTag()End the current tag.voidsetExceptionOnNullDelegate(boolean throwException) determines if an exception is thrown when an event arrives without the delegate being set.voidA new record is about to start.voidStart a new tag.voidvalue(TagValueContext ctxt, Object value) A value has been seen.
-
Constructor Details
-
SimpleStateListener
public SimpleStateListener()
-
-
Method Details
-
setExceptionOnNullDelegate
determines if an exception is thrown when an event arrives without the delegate being set. Default is that a ParserException is thrown. i -
startTag
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
Description copied from interface:TagValueListenerEnd the current tag.- Specified by:
endTagin interfaceTagValueListener- Throws:
ParserException- if the tag could not be ended
-
startRecord
Description copied from interface:TagValueListenerA new record is about to start.- Specified by:
startRecordin interfaceTagValueListener- Throws:
ParserException- if the record can not be started
-
endRecord
Description copied from interface:TagValueListenerThe current record has ended.- Specified by:
endRecordin interfaceTagValueListener- Throws:
ParserException- if the record can not be ended
-
value
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
-