public class MultiTagger extends SimpleTagValueWrapper
With tag-value files, it is not uncommon for information about logical blocks of data to be encoded in the values as well as tags of the document. For example, in swissprot entries, the comment block may be punctuated by lines that clearly seperate one logical comment from another, but there may be no change in the pattern of tags to indicate this. Some fields, such as alternate names in Enzyme, are a ist of values but some of the values are longer than a single line. Each value is terminated with a period ".", but again there is no way from the tags to know the logical grouping.
This class provides callbacks to allow event streams to be re-written so that they contain this information. A single CC tag with multiple values can be re-written as multiple CC tags with values for each logical comment. This is done by presenting each value to an instance of Agregator.Observer that indicates if the current value signals the end of a logcal block.
Constructor and Description |
---|
MultiTagger(TagValueListener listener,
BoundaryFinder observer) |
Modifier and Type | Method and Description |
---|---|
void |
endTag()
End the current tag.
|
BoundaryFinder |
getBoundaryFinder() |
void |
startTag(Object tag)
Start a new tag.
|
void |
value(TagValueContext ctxt,
Object value)
A value has been seen.
|
endRecord, getDelegate, setDelegate, startRecord
public MultiTagger(TagValueListener listener, BoundaryFinder observer)
public BoundaryFinder getBoundaryFinder()
public void startTag(Object tag) throws ParserException
TagValueListener
startTag
in interface TagValueListener
startTag
in class SimpleTagValueWrapper
tag
- the Object representing the new tagParserException
- if the tag could not be startedpublic void value(TagValueContext ctxt, Object value) throws ParserException
TagValueListener
value
in interface TagValueListener
value
in class SimpleTagValueWrapper
ctxt
- a TagValueContext that could be used to push a sub-documentvalue
- the value Object observedParserException
- if the value could not be processedpublic void endTag() throws ParserException
TagValueListener
endTag
in interface TagValueListener
endTag
in class SimpleTagValueWrapper
ParserException
- if the tag could not be endedCopyright © 2020 BioJava. All rights reserved.