| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private List | |
| private List | |
| private List | |
| private List | |
| private boolean | |
| private List | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | FixedWidthFields(LinkedHashMap<String, Integer>
a fields)LinkedHashMap containing the sequence of fields to be associated with each column in the input/output, with their respective length.Defines a sequence of field names used to refer to columns in the input/output text of an entity, along with their lengths. |
| public | FixedWidthFields(String[]
the sequence of fields to be associated with each column in the input/output headers, int[] the sequence of lengths to be associated with each given header. The size of this array must match the number of given headers. lengths)Defines a sequence of field names used to refer to columns in the input/output text of an entity, along with their lengths. |
| public | FixedWidthFields(int...
The number lengths of all fields in a fixed-width record. All lengths must be greater than 0. fieldLengths)Creates a new instance initialized with the lengths of all fields in a fixed-width record. |
| public | FixedWidthFields(Class<T>
the class whose beanClass)FixedWidth annotations will be processed to configure this field list.
Deprecated
use
Creates a new instance initialized from forParsing(Class) and forWriting(Class) to initialize the fields from the given
class and filter out getters and setters that target the same field.
FixedWidth annotations in the fields and methods of a given class.
|
| private | FixedWidthFields(Class<T>
the class whose beanClass, MethodFilter FixedWidth annotations will be processed to configure this field list.filter to apply over annotated methods when the fixed-width writer is reading data from beans (to write values to an output)
or writing values into beans (when parsing). It is used to choose either a "get" or a "set"
method annotated with methodFilter)Parsed, when both methods target the same field.Creates a new instance initialized from |
| Modifier and Type | Method and Description |
|---|---|
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.starting position of the field. startPosition, int ending position of the field endPosition)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the name of the next field. It is not validated. name, int starting position of the field. startPosition, int ending position of the field endPosition, char the representation of unused space in this field padding)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the name of the next field. It is not validated. name, int starting position of the field. startPosition, int ending position of the field endPosition, FieldAlignment the alignment of the field alignment)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.starting position of the field. startPosition, int ending position of the field endPosition, FieldAlignment the alignment of the field alignment)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.starting position of the field. startPosition, int ending position of the field endPosition, FieldAlignment the alignment of the field alignment, char the representation of unused space in this field padding)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.starting position of the field. startPosition, int ending position of the field endPosition, char the representation of unused space in this field padding)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the name of the next field. It is not validated. name, int starting position of the field. startPosition, int ending position of the field endPosition, FieldAlignment the alignment of the field alignment, char the representation of unused space in this field padding)Adds the range of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the length of the next field. It must be greater than 0. length)Adds the length of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the length of the next field. It must be greater than 0. length, FieldAlignment the alignment of the field alignment)Adds the length of the next field in a fixed-width record. |
| public FixedWidthFields | |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the name of the next field. It is not validated. name, int the length of the next field. It must be greater than 0. length, FieldAlignment the alignment of the field alignment)Adds the length of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the length of the next field. It must be greater than 0. length, char the representation of unused space in this field padding)Adds the length of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the length of the next field. It must be greater than 0. length, FieldAlignment the alignment of the field alignment, char the representation of unused space in this field padding)Adds the length of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the name of the next field. It is not validated. name, int the length of the next field. It must be greater than 0. length, char the representation of unused space in this field padding)Adds the length of the next field in a fixed-width record. |
| public FixedWidthFields | Returns: the FixedWidthFields instance itself for chaining.the name of the next field. It is not validated. name, int the length of the next field. It must be greater than 0. length, FieldAlignment the alignment of the field alignment, char the representation of unused space in this field padding)Adds the length of the next field in a fixed-width record. |
| protected FixedWidthFields | |
| public static FixedWidthFields | Returns: a newFixedWidthFields instance built with the FixedWidth annotations found in the given class' attributes and methods (excluding getters)the class whose beanClass)FixedWidth annotations will be processed to configure this field list.Creates a new instance initialized from |
| public static FixedWidthFields | Returns: a newFixedWidthFields instance built with the FixedWidth annotations found in the given class' attributes and methods (excluding setters)the class whose beanClass)FixedWidth annotations will be processed to configure this field list.Creates a new instance initialized from |
| public FieldAlignment | Returns: the alignment of the fieldthe index of the field whose alignment will be returned position)Returns the alignment of a given field. |
| public FieldAlignment | Returns: the alignment of the given fieldthe name of the field whose alignment will be returned fieldName)Returns the alignment of a given field. |
| pack-priv int[] | |
| public FieldAlignment[] | Returns: the sequence of alignment settings to apply over each field in the fixed-width record.Returns a copy of the sequence of alignment settings to apply over each field in the fixed-width record. |
| public int[] | Returns: a copy of the sequence of field lengths of a fixed-width recordReturns a copy of the sequence of field lengths of a fixed-width record |
| public NormalizedString[] | Returns: the name of each field in a fixed-width record, or null if no name has been defined.Returns the name of each field in a fixed-width record, if any |
| public char[] | Returns: the sequence of padding characters to apply over each field in the fixed-width record.Returns a copy of the sequence of padding characters to apply over each field in the fixed-width record. |
| pack-priv char[] | |
| public int | Returns: the number of fields in a fixed-width recordReturns the number of fields in a fixed-width record |
| pack-priv boolean[] | Returns: the sequence of fields to ignore.Returns the sequence of fields to ignore. |
| pack-priv Boolean[] | Returns: the sequence that have an explicit 'keepPadding' flag.Returns the sequence of fields whose padding character must/must not be retained in the parsed value |
| private <T> List | |
| public int | |
| public void | keepPaddingOn(int
the positions of the fields that should keep the padding character position, int... additional positions positions)Configures a given list of fields to retain the padding character in any parsed values,
overriding the any default set for the whole input in |
| public void | keepPaddingOn(String
the name of the first field that should keep the padding character name, String... the names of more fields that should keep the padding character names)Configures a given list of fields to retain the padding character in any parsed values,
overriding the any default set for the whole input in |
| public void | setAlignment(FieldAlignment
the alignment to apply alignment, int... the positions of the fields that should be aligned positions)Applies alignment to a given list of fields |
| public void | setAlignment(FieldAlignment
the alignment to apply alignment, String... the names of the fields that should be aligned names)Applies alignment to a given list of fields |
| private void | |
| public void | setFieldLength(String
the name of the field whose length must be altered name, int the new length of the given field newLength)Modifies the length of a given field |
| public void | setFieldLength(int
the position of the field whose length must be altered position, int the new length of the given field newLength)Modifies the length of a given field |
| pack-priv static void | |
| private void | |
| private void | |
| public void | setPadding(char
the padding to apply padding, int... the positions of the fields that should use the given padding character positions)Applies a custom padding character to a given list of fields |
| public void | setPadding(char
the padding to apply padding, String... the names of the fields that should use the given padding character names)Applies a custom padding character to a given list of fields |
| private void | |
| private void | |
| public void | stripPaddingFrom(int
the positions of the fields that should keep the padding character position, int... additional positions positions)Configures a given list of fields to remove the padding character in any parsed values,
overriding the any default set for the whole input in |
| public void | stripPaddingFrom(String
the name of the first field that have any padding characters removed name, String... the names of the fields that should have any padding characters removed names)Configures a given list of fields to remove the padding character in any parsed values,
overriding the any default set for the whole input in |
| public String | |
| private void | |
| private void |
| fieldAlignment | back to summary |
|---|---|
| private List<FieldAlignment> fieldAlignment | |
| fieldLengths | back to summary |
|---|---|
| private List<Integer> fieldLengths | |
| fieldNames | back to summary |
|---|---|
| private List<NormalizedString> fieldNames | |
| fieldPadding | back to summary |
|---|---|
| private List<Character> fieldPadding | |
| fieldsToIgnore | back to summary |
|---|---|
| private List<Boolean> fieldsToIgnore | |
| noNames | back to summary |
|---|---|
| private boolean noNames | |
| paddingsToKeep | back to summary |
|---|---|
| private List<Boolean> paddingsToKeep | |
| totalLength | back to summary |
|---|---|
| private int totalLength | |
| FixedWidthFields | back to summary |
|---|---|
| public FixedWidthFields(LinkedHashMap<String, Integer> fields) Defines a sequence of field names used to refer to columns in the input/output text of an entity, along with their lengths.
The field names defined will be used as headers, having the same effect of a call to
| |
| FixedWidthFields | back to summary |
|---|---|
| public FixedWidthFields(String[] headers, int[] lengths) Defines a sequence of field names used to refer to columns in the input/output text of an entity, along with their lengths.
The field names defined will be used as headers, having the same effect of a call to
| |
| FixedWidthFields | back to summary |
|---|---|
| public FixedWidthFields(int... fieldLengths) Creates a new instance initialized with the lengths of all fields in a fixed-width record.
| |
| FixedWidthFields | back to summary |
|---|---|
| public FixedWidthFields(Class<T> beanClass)
Deprecated use Creates a new instance initialized from
| |
| FixedWidthFields | back to summary |
|---|---|
| private FixedWidthFields(Class<T> beanClass, MethodFilter methodFilter) Creates a new instance initialized from
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int startPosition, int endPosition) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int startPosition, int endPosition) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int startPosition, int endPosition, char padding) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int startPosition, int endPosition, FieldAlignment alignment) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int startPosition, int endPosition, FieldAlignment alignment) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int startPosition, int endPosition, FieldAlignment alignment, char padding) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int startPosition, int endPosition, char padding) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int startPosition, int endPosition, FieldAlignment alignment, char padding) Adds the range of the next field in a fixed-width record. The given range cannot overlap with previously defined fields. Blanks will be used to fill any "gap" between record ranges when writing.
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int length) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField(5).addField(6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int length, FieldAlignment alignment) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField(5).addField(6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int length) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField("field_1", 5).addField("field_2", 6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int length, FieldAlignment alignment) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField("field_1", 5).addField("field_2", 6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int length, char padding) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField(5).addField(6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(int length, FieldAlignment alignment, char padding) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField(5).addField(6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int length, char padding) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField("field_1", 5).addField("field_2", 6)...
| |
| addField | back to summary |
|---|---|
| public FixedWidthFields addField(String name, int length, FieldAlignment alignment, char padding) Adds the length of the next field in a fixed-width record. This method can be chained like this: addField("field_1", 5).addField("field_2", 6)...
| |
| clone | back to summary |
|---|---|
| protected FixedWidthFields clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| forParsing | back to summary |
|---|---|
| public static FixedWidthFields forParsing(Class<T> beanClass) Creates a new instance initialized from
| |
| forWriting | back to summary |
|---|---|
| public static FixedWidthFields forWriting(Class<T> beanClass) Creates a new instance initialized from
| |
| getAlignment | back to summary |
|---|---|
| public FieldAlignment getAlignment(int position) Returns the alignment of a given field.
| |
| getAlignment | back to summary |
|---|---|
| public FieldAlignment getAlignment(String fieldName) Returns the alignment of a given field. An
| |
| getAllLengths | back to summary |
|---|---|
| pack-priv int[] getAllLengths() | |
| getFieldAlignments | back to summary |
|---|---|
| public FieldAlignment[] getFieldAlignments() Returns a copy of the sequence of alignment settings to apply over each field in the fixed-width record.
| |
| getFieldLengths | back to summary |
|---|---|
| public int[] getFieldLengths() Returns a copy of the sequence of field lengths of a fixed-width record
| |
| getFieldNames | back to summary |
|---|---|
| public NormalizedString[] getFieldNames() Returns the name of each field in a fixed-width record, if any
| |
| getFieldPaddings | back to summary |
|---|---|
| public char[] getFieldPaddings() Returns a copy of the sequence of padding characters to apply over each field in the fixed-width record.
The null character (
| |
| getFieldPaddings | back to summary |
|---|---|
| pack-priv char[] getFieldPaddings(FixedWidthFormat format) | |
| getFieldsPerRecord | back to summary |
|---|---|
| public int getFieldsPerRecord() Returns the number of fields in a fixed-width record
| |
| getFieldsToIgnore | back to summary |
|---|---|
| pack-priv boolean[] getFieldsToIgnore() Returns the sequence of fields to ignore.
| |
| getKeepPaddingFlags | back to summary |
|---|---|
| pack-priv Boolean[] getKeepPaddingFlags() Returns the sequence of fields whose padding character must/must not be retained in the parsed value
| |
| getSelectedElements | back to summary |
|---|---|
| private <T> List | |
| indexOf | back to summary |
|---|---|
| public int indexOf(String fieldName) Returns the index of a field name. An
| |
| keepPaddingOn | back to summary |
|---|---|
| public void keepPaddingOn(int position, int... positions) Configures a given list of fields to retain the padding character in any parsed values,
overriding the any default set for the whole input in
| |
| keepPaddingOn | back to summary |
|---|---|
| public void keepPaddingOn(String name, String... names) Configures a given list of fields to retain the padding character in any parsed values,
overriding the any default set for the whole input in | |
| setAlignment | back to summary |
|---|---|
| public void setAlignment(FieldAlignment alignment, int... positions) Applies alignment to a given list of fields
| |
| setAlignment | back to summary |
|---|---|
| public void setAlignment(FieldAlignment alignment, String... names) Applies alignment to a given list of fields
| |
| setAlignment | back to summary |
|---|---|
| private void setAlignment(int position, FieldAlignment alignment) | |
| setFieldLength | back to summary |
|---|---|
| public void setFieldLength(String name, int newLength) Modifies the length of a given field
| |
| setFieldLength | back to summary |
|---|---|
| public void setFieldLength(int position, int newLength) Modifies the length of a given field
| |
| setHeadersIfPossible | back to summary |
|---|---|
| pack-priv static void setHeadersIfPossible(FixedWidthFields fieldLengths, CommonSettings<F extends Format> settings) | |
| setKeepPaddingFlag | back to summary |
|---|---|
| private void setKeepPaddingFlag(boolean keep, int position, int... positions) | |
| setKeepPaddingFlag | back to summary |
|---|---|
| private void setKeepPaddingFlag(boolean keep, String name, String... names) | |
| setPadding | back to summary |
|---|---|
| public void setPadding(char padding, int... positions) Applies a custom padding character to a given list of fields
| |
| setPadding | back to summary |
|---|---|
| public void setPadding(char padding, String... names) Applies a custom padding character to a given list of fields
| |
| setPadding | back to summary |
|---|---|
| private void setPadding(int position, char padding) | |
| setPaddingToKeep | back to summary |
|---|---|
| private void setPaddingToKeep(int position, boolean keepPaddingFlag) | |
| stripPaddingFrom | back to summary |
|---|---|
| public void stripPaddingFrom(int position, int... positions) Configures a given list of fields to remove the padding character in any parsed values,
overriding the any default set for the whole input in
| |
| stripPaddingFrom | back to summary |
|---|---|
| public void stripPaddingFrom(String name, String... names) Configures a given list of fields to remove the padding character in any parsed values,
overriding the any default set for the whole input in | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| validateIndex | back to summary |
|---|---|
| private void validateIndex(int position) | |
| validateLength | back to summary |
|---|---|
| private void validateLength(String name, int length) | |