Package org.biojava.bio.program.tagvalue
Class Aggregator
- java.lang.Object
-
- org.biojava.bio.program.tagvalue.SimpleTagValueWrapper
-
- org.biojava.bio.program.tagvalue.Aggregator
-
- All Implemented Interfaces:
TagValueListener,TagValueWrapper
public class Aggregator extends SimpleTagValueWrapper
Joins multipel values into single values.Some properties have values spread across multiple lines. For example, the properties on EMBL features can be spread across multiple lines.
This class provides callbacks to allow event streams to be re-written so that they contain this information.
- Since:
- 1.4
- Author:
- Matthew Pocock
-
-
Constructor Summary
Constructors Constructor Description Aggregator(TagValueListener listener, BoundaryFinder observer, String joiner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendTag()End the current tag.BoundaryFindergetBoundaryFinder()StringgetJoiner()voidsetBoundaryFinder(BoundaryFinder finder)voidsetJoiner(String joiner)voidstartTag(Object tag)Start a new tag.voidvalue(TagValueContext ctxt, Object value)A value has been seen.-
Methods inherited from class org.biojava.bio.program.tagvalue.SimpleTagValueWrapper
endRecord, getDelegate, setDelegate, startRecord
-
-
-
-
Constructor Detail
-
Aggregator
public Aggregator(TagValueListener listener, BoundaryFinder observer, String joiner)
-
-
Method Detail
-
getBoundaryFinder
public BoundaryFinder getBoundaryFinder()
-
setBoundaryFinder
public void setBoundaryFinder(BoundaryFinder finder)
-
startTag
public void startTag(Object tag) throws ParserException
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
-
value
public void value(TagValueContext ctxt, Object value) throws ParserException
Description copied from interface:TagValueListenerA value has been seen.- Specified by:
valuein interfaceTagValueListener- Overrides:
valuein classSimpleTagValueWrapper- 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
-
endTag
public void endTag() throws ParserException
Description copied from interface:TagValueListenerEnd the current tag.- Specified by:
endTagin interfaceTagValueListener- Overrides:
endTagin classSimpleTagValueWrapper- Throws:
ParserException- if the tag could not be ended
-
-