|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.ParserOutput
public class ParserOutput
The ParserOutput is the component that manages records parsed by AbstractParser and their values.
It is solely responsible for deciding when:
CommonSettingsAbstractParser.parseRecord() should be retained or discardedAbstractParser.parseRecord() or from CommonSettings.getHeaders()AbstractParser.
AbstractParser,
CommonSettings| Field Summary | |
|---|---|
CharAppender |
appender
The appender available to parsers for accumulating characters read from the input. |
protected int |
column
Keeps track of the current column being parsed in the input. |
protected String[] |
parsedValues
Stores the values parsed for a record. |
protected CommonParserSettings<?> |
settings
|
boolean |
trim
|
| Constructor Summary | |
|---|---|
ParserOutput(AbstractParser<?> parser,
CommonParserSettings<?> settings)
Initializes the ParserOutput with the configuration specified in CommonParserSettings |
|
ParserOutput(CommonParserSettings<?> settings)
Initializes the ParserOutput with the configuration specified in CommonParserSettings |
|
| Method Summary | |
|---|---|
void |
discardValues()
Discards the values parsed so far |
void |
emptyParsed()
Adds a nullValue (as specified in CommonSettings.getNullValue()) to the output and prepares the next position in the record to receive more values. |
int |
getCurrentColumn()
Returns the position of the current parsed value |
long |
getCurrentRecord()
Returns the current record index. |
String[] |
getHeaders()
Returns the sequence of values that represent the headers each field in the input. |
int[] |
getSelectedIndexes()
Returns the selected indexes of all fields as defined in CommonSettings. |
protected void |
initializeHeaders()
|
boolean |
isColumnReorderingEnabled()
Indicates whether fields selected using the field selection methods (in CommonSettings) are being reordered. |
String[] |
rowParsed()
Gets all values parsed in the parsedValues array |
void |
valueParsed()
Adds the accumulated value in the appender object to the output and prepares the next position in the record to receive more values. |
void |
valueParsed(String value)
Adds a value processed externally to the output and prepares the next position in the record to receive more values |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int column
valueParsed() and emptyParsed() will increase the column count.
This value is reset to zero after a row is parsed.
protected final String[] parsedValues
protected final CommonParserSettings<?> settings
public CharAppender appender
The appender available to parsers for accumulating characters read from the input.
This attribute is assigned to different instances of CharAppender during parsing process, namely,
a (potentially) different CharAppender for each parsed column, taken from
appenders[column]
public boolean trim
| Constructor Detail |
|---|
public ParserOutput(CommonParserSettings<?> settings)
CommonParserSettings
settings - the parser configuration
public ParserOutput(AbstractParser<?> parser,
CommonParserSettings<?> settings)
CommonParserSettings
parser - the parser whose output will be managed by this class.settings - the parser configuration| Method Detail |
|---|
protected void initializeHeaders()
public String[] rowParsed()
parsedValues array
public String[] getHeaders()
CommonSettings.getHeaders()
public int[] getSelectedIndexes()
CommonSettings. Null if no fields were selected.
CommonSettings. Null if no fields were selected.public boolean isColumnReorderingEnabled()
CommonSettings) are being reordered.
false if no fields were selected or column reordering has been disabled in CommonParserSettings.isColumnReorderingEnabled()
true if fields were selected and column reordering has been enabled in CommonParserSettings.isColumnReorderingEnabled()
public int getCurrentColumn()
public void emptyParsed()
CommonSettings.getNullValue()) to the output and prepares the next position in the record to receive more values.
public void valueParsed()
public void valueParsed(String value)
value - the value to be added to the current record position.public long getCurrentRecord()
rowParsed().
public final void discardValues()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||