Package org.biojava.bio.program.tagvalue
Class RegexFieldFinder
- java.lang.Object
-
- org.biojava.bio.program.tagvalue.SimpleTagValueWrapper
-
- org.biojava.bio.program.tagvalue.RegexFieldFinder
-
- All Implemented Interfaces:
TagValueListener,TagValueWrapper
public class RegexFieldFinder extends SimpleTagValueWrapper
-
-
Constructor Summary
Constructors Constructor Description RegexFieldFinder(TagValueListener delegate, Pattern pattern, String[] tags, boolean inLine)Creates a new RegexFiledFinder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendTag()End the current tag.voidstartTag(Object tag)Start a new tag.voidvalue(TagValueContext ctxt, Object val)A value has been seen.-
Methods inherited from class org.biojava.bio.program.tagvalue.SimpleTagValueWrapper
endRecord, getDelegate, setDelegate, startRecord
-
-
-
-
Constructor Detail
-
RegexFieldFinder
public RegexFieldFinder(TagValueListener delegate, Pattern pattern, String[] tags, boolean inLine)
Creates a new RegexFiledFinder.- Parameters:
delegate- the TagValueListener to forward events topattern- a Pattern to match to valuestags- an array of Strings giving tag names for each group in the patterninLine- if false, an entire sub-document will be generated for the parent tag
-
-
Method Detail
-
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
-
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
-
value
public void value(TagValueContext ctxt, Object val) 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-documentval- the value Object observed- Throws:
ParserException- if the value could not be processed
-
-