public class LineSplitParser extends Object implements TagValueParser, Cloneable
A parser that splits a line into tag/value at a given column number. The GENBANK and EMBL constants are parsers pre-configured for genbank and embl style files respectively.
There are many properties of the parser that can be set to change how lines are split, and how the tag and value is produced from that split.
Modifier and Type | Field and Description |
---|---|
static LineSplitParser |
EMBL
A LineSplitParser pre-configured to process EMBL-style flat files.
|
static LineSplitParser |
GENBANK
A LineSplitParser pre-configured to process GENBANK-style flat files.
|
EMPTY_LINE_EOR
Constructor and Description |
---|
LineSplitParser() |
LineSplitParser(LineSplitParser parser) |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
getContinueOnEmptyTag()
See if empty tags are treated as a continuation of previous tags or as a
new tag with the value of the empty string.
|
String |
getEndOfRecord()
Get the current string indicating that a record has ended.
|
boolean |
getMergeSameTag()
See if tags are being merged.
|
int |
getSplitOffset()
Get the current offset at which lines are split.
|
boolean |
getTrimTag()
See if tag trimming is enabled.
|
boolean |
getTrimValue()
See if value trimming is enabled.
|
TagValue |
parse(Object o) |
void |
setContinueOnEmptyTag(boolean continueOnEmptyTag)
Choose whether to treat empty tags as a continuation of previous tags or as a
new tag with the value of the empty string.
|
void |
setEndOfRecord(String endOfRecord)
Set the string indicating that a record has ended.
|
void |
setMergeSameTag(boolean mergeSameTag)
Enable or disable treating runs of identical tags as a single tag start
event with multiple values or each as a separate tag start, value, and tag
end.
|
void |
setSplitOffset(int splitOffset)
Set the offset to split lines at.
|
void |
setTrimTag(boolean trimTag)
Enable or disable trimming of tags.
|
void |
setTrimValue(boolean trimValue)
Enable or disable trimming of values.
|
public static final LineSplitParser EMBL
public static final LineSplitParser GENBANK
public LineSplitParser()
public LineSplitParser(LineSplitParser parser)
public void setEndOfRecord(String endOfRecord)
endOfRecord
- the new String delimiting recordspublic String getEndOfRecord()
public void setSplitOffset(int splitOffset)
splitOffset
- the new offset to split atpublic int getSplitOffset()
public void setTrimTag(boolean trimTag)
trimTag
- true if tags should be trimmed, otherwise falsepublic boolean getTrimTag()
public void setTrimValue(boolean trimValue)
trimValue
- true if values should be trimmed, otherwise falsepublic boolean getTrimValue()
public void setContinueOnEmptyTag(boolean continueOnEmptyTag)
continueOnEmptyTag
- true to enable empty tags to be treated as a
continuation of the previous tag, false otherwisepublic boolean getContinueOnEmptyTag()
public void setMergeSameTag(boolean mergeSameTag)
mergeSameTag
- true if tags should be merged, false otherwisepublic boolean getMergeSameTag()
public TagValue parse(Object o)
parse
in interface TagValueParser
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2020 BioJava. All rights reserved.