CsvCallbackHandler implementations.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | AbstractInternalCsvCallbackHandler.
the type of the actual builder T extends AbstractInternalCsvCallbackHandler.Abstract builder for |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| protected int | fieldIdx
The current index in the internal fields array. |
| protected final FieldModifier | fieldModifier
The field modifier. |
| protected String[] | fields
The internal fields array. |
| protected final int | maxFields
The maximum number of fields a single record may have. |
| protected final int | maxFieldSize
The maximum number of characters a single field may have. |
| protected final int | maxRecordSize
The maximum number of characters a single record may have. |
| protected int | recordSize
The total size (sum of all characters) of the current record. |
| protected RecordType | recordType
The type of the current record. |
| protected long | startingLineNumber
The starting line number of the current record. |
| Access | Constructor and Description |
|---|---|
| protected | AbstractInternalCsvCallbackHandler(final int
the maximum number of fields; must be > 0 maxFields, final int the maximum field size; must be > 0 maxFieldSize, final int the maximum record size; must be > 0 and >= maxRecordSize, final FieldModifier maxFieldSizethe field modifier; must not be fieldModifier)nullConstructs a new instance with the given configuration. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addField(final char[] buf, final int offset, final int len, final boolean quoted)
Implements abstract de. Called for each field in the record. |
| protected void | beginRecord(final long startingLineNumber)
Implements abstract de. Called at the beginning of each record. |
| protected String[] | Returns: the compact fields arrayBuilds a compact fields array (a copy of the internal fields array with the length of the current record). |
| private void | |
| protected int | getFieldCount()
Implements abstract de. Returns the number of fields in the record. |
| public RecordType | getRecordType()
Implements abstract de. Returns the type of the record that is built from the CSV data. |
| private String | |
| private String | |
| protected String | Returns: the modified comment valuethe comment value field)Modifies comment value. |
| protected String | Returns: the modified field valuethe field value value, final boolean true if the field was quotedModifies field value. |
| protected void | setComment(final char[] buf, final int offset, final int len)
Implements abstract de. Called for each comment line. |
| protected void | setEmpty()
Implements abstract de. Called for each empty line. |
| DEFAULT_INITIAL_FIELDS_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_INITIAL_FIELDS_SIZE | |
| fieldIdx | back to summary |
|---|---|
| protected int fieldIdx The current index in the internal fields array. | |
| fieldModifier | back to summary |
|---|---|
| protected final FieldModifier fieldModifier The field modifier. | |
| fields | back to summary |
|---|---|
| protected String[] fields The internal fields array. | |
| maxFields | back to summary |
|---|---|
| protected final int maxFields The maximum number of fields a single record may have. | |
| maxFieldSize | back to summary |
|---|---|
| protected final int maxFieldSize The maximum number of characters a single field may have. | |
| maxRecordSize | back to summary |
|---|---|
| protected final int maxRecordSize The maximum number of characters a single record may have. | |
| recordSize | back to summary |
|---|---|
| protected int recordSize The total size (sum of all characters) of the current record. | |
| recordType | back to summary |
|---|---|
| protected RecordType recordType The type of the current record. | |
| startingLineNumber | back to summary |
|---|---|
| protected long startingLineNumber The starting line number of the current record. See | |
| AbstractInternalCsvCallbackHandler | back to summary |
|---|---|
| protected AbstractInternalCsvCallbackHandler(final int maxFields, final int maxFieldSize, final int maxRecordSize, final FieldModifier fieldModifier) Constructs a new instance with the given configuration.
| |
| addField | back to summary |
|---|---|
| protected void addField(final char[] buf, final int offset, final int len, final boolean quoted) Implements abstract de. Doc from de. Called for each field in the record. A record can either be a comment or a regular record. If this method is called, the record is a regular record and cannot be a comment. The The
| |
| beginRecord | back to summary |
|---|---|
| protected void beginRecord(final long startingLineNumber) Implements abstract de. Doc from de. Called at the beginning of each record. The
| |
| compactFields | back to summary |
|---|---|
| protected String[] compactFields() Builds a compact fields array (a copy of the internal fields array with the length of the current record). In contrast to the class property
| |
| extendCapacity | back to summary |
|---|---|
| private void extendCapacity() | |
| getFieldCount | back to summary |
|---|---|
| protected int getFieldCount() Implements abstract de. Doc from de. Returns the number of fields in the record. The
| |
| getRecordType | back to summary |
|---|---|
| public RecordType getRecordType() Implements abstract de. Doc from de. Returns the type of the record that is built from the CSV data. The
| |
| maxFieldSizeExceededMessage | back to summary |
|---|---|
| private String maxFieldSizeExceededMessage() | |
| maxRecordSizeExceededMessage | back to summary |
|---|---|
| private String maxRecordSizeExceededMessage() | |
| modifyComment | back to summary |
|---|---|
| protected String modifyComment(final String field) Modifies comment value. | |
| modifyField | back to summary |
|---|---|
| protected String modifyField(final String value, final boolean quoted) Modifies field value. | |
| setComment | back to summary |
|---|---|
| protected void setComment(final char[] buf, final int offset, final int len) Implements abstract de. Doc from de. Called for each comment line. Note that the comment character is not included in the value. This method is not called if
There can only be one invocation of this method per record. A record can either be a comment or a regular record. If this method is called, the record is a comment and cannot be a regular record. The
| |
| setEmpty | back to summary |
|---|---|
| protected void setEmpty() Implements abstract de. Doc from de. Called for each empty line.
| |
AbstractInternalCsvCallbackHandler subclasses.
This class is for internal use only and should not be used directly. It will be sealed in a future release.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final int | |
| protected FieldModifier | fieldModifier
The field modifier. |
| protected int | maxFields
The maximum number of fields a single record may have. |
| protected int | maxFieldSize
The maximum number of characters a single field may have. |
| protected int | maxRecordSize
The maximum number of characters a single record may have. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: This updated object, allowing additional method calls to be chained together.the field modifier; must not be fieldModifier)null (default: FieldModifiers#NOP)Sets the field modifier. |
| public T | Returns: This updated object, allowing additional method calls to be chained together.the maximum fields a record may have; must be > 0
(default: 16384) maxFields)Defines the maximum number of fields a single record may have. |
| public T | Returns: This updated object, allowing additional method calls to be chained together.the maximum field size; must be > 0
(default: 16777216) maxFieldSize)Defines the maximum number of characters a single field may have. |
| public T | Returns: This updated object, allowing additional method calls to be chained together.the maximum record size; must be > 0
(default: 67108864) maxRecordSize)Defines the maximum number of characters a single record may have. |
| protected abstract T | Returns: This object of subclass type.Method to be implemented by subclasses to return the correct type. |
| DEFAULT_MAX_FIELD_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_MAX_FIELD_SIZE | |
| DEFAULT_MAX_FIELDS | back to summary |
|---|---|
| private static final int DEFAULT_MAX_FIELDS | |
| DEFAULT_MAX_RECORD_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_MAX_RECORD_SIZE | |
| fieldModifier | back to summary |
|---|---|
| protected FieldModifier fieldModifier The field modifier.
The default value is | |
| maxFields | back to summary |
|---|---|
| protected int maxFields The maximum number of fields a single record may have. The default value is 16384. | |
| maxFieldSize | back to summary |
|---|---|
| protected int maxFieldSize The maximum number of characters a single field may have. The default value is 16777216. | |
| maxRecordSize | back to summary |
|---|---|
| protected int maxRecordSize The maximum number of characters a single record may have. The default value is 67108864. | |
| AbstractInternalCsvCallbackHandlerBuilder | back to summary |
|---|---|
| protected AbstractInternalCsvCallbackHandlerBuilder() Constructs a new default instance. | |
| fieldModifier | back to summary |
|---|---|
| public T fieldModifier(final FieldModifier fieldModifier) Sets the field modifier.
| |
| maxFields | back to summary |
|---|---|
| public T maxFields(final int maxFields) Defines the maximum number of fields a single record may have. This constraint is enforced for all fields, including the header.
| |
| maxFieldSize | back to summary |
|---|---|
| public T maxFieldSize(final int maxFieldSize) Defines the maximum number of characters a single field may have. This constraint is enforced for all fields, including the header and comments. The size of the field is determined after field modifiers are applied. In contrast to
| |
| maxRecordSize | back to summary |
|---|---|
| public T maxRecordSize(final int maxRecordSize) Defines the maximum number of characters a single record may have. This constraint is enforced for all fields, including the header and comments. The size of the record is the sum of the sizes of all fields. The size of each field is determined after field modifiers are applied. Make sure that
| |
| self | back to summary |
|---|---|
| protected abstract T self() Method to be implemented by subclasses to return the correct type.
| |