|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.ContextWrapper<T>
public abstract class ContextWrapper<T extends Context>
A simple a wrapper for a Context.
| Field Summary | |
|---|---|
protected T |
context
|
| Constructor Summary | |
|---|---|
ContextWrapper(T context)
Wraps a Context. |
|
| Method Summary | |
|---|---|
boolean |
columnsReordered()
Indicates whether selected fields are being reordered. |
int |
currentColumn()
Returns the column index of the record being processed. |
long |
currentRecord()
Returns the index of the last valid record parsed from the input |
int[] |
extractedFieldIndexes()
Returns the indexes of each field extracted from the input when fields are selected. |
String[] |
headers()
Returns the file headers that identify each parsed record. |
int |
indexOf(Enum<?> header)
Returns the position of a header (0 based). |
int |
indexOf(String header)
Returns the position of a header (0 based). |
boolean |
isStopped()
Identifies whether the parser is running. |
String[] |
selectedHeaders()
|
void |
stop()
Stops the parsing process. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final T extends Context context
| Constructor Detail |
|---|
public ContextWrapper(T context)
Context.
context - the context object to be wrapped.| Method Detail |
|---|
public String[] headers()
Context
headers in interface Contextpublic int[] extractedFieldIndexes()
ContextThe indexes are relative to their original position in the input.
For example, if the input has the fields "A, B, C, D", and the selected fields are "A, D", then the extracted field indexes will return [0, 3]
If no fields were selected, then this method will return null. This means all fields are being parsed.
extractedFieldIndexes in interface ContextCommonSettingspublic boolean columnsReordered()
ContextIf columns are reordered, each parsed record will contain values only for the selected fields, as specified by Context.extractedFieldIndexes()
columnsReordered in interface ContextCommonParserSettings,
CommonSettingspublic int indexOf(String header)
Context
indexOf in interface Contextheader - the header whose position will be returned
public int indexOf(Enum<?> header)
Context
indexOf in interface Contextheader - the header whose position will be returned
public int currentColumn()
Context
currentColumn in interface Contextpublic long currentRecord()
Context
currentRecord in interface Contextpublic void stop()
Context
stop in interface Contextpublic boolean isStopped()
Context
isStopped in interface Contextpublic String[] selectedHeaders()
selectedHeaders in interface Context
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||