FixedWidthWriter)
The FixedWidthWriterSettings provides all configuration options in CommonWriterSettings and currently does not require any additional setting.
The FixedWidthParserSettings requires a definition of the field lengths of each record in the input. This must provided using an instance of FixedWidthFields.
com.univocity.parsers.fixed.FixedWidthWriter , com.univocity.parsers.fixed.FixedWidthFormat , FixedWidthFields, com.univocity.parsers.common.CommonWriterSettings
| Modifier and Type | Field and Description |
|---|---|
| private FieldAlignment | |
| private FixedWidthFields | |
| private Map | |
| private Map | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | FixedWidthWriterSettings(FixedWidthFields
the instance of fieldLengths)FixedWidthFields which provides the lengths of each field in the fixed-width records to be parsedYou can only create an instance of this class by providing a definition of the field lengths of each record in the input. |
| public | FixedWidthWriterSettings()
Creates a basic configuration object for the Fixed-Width writer with no field length configuration. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | addFormatForLookahead(String
the lookahead value that when found in the output row,
will notify the writer to switch to a new record format, with different field lengths lookahead, FixedWidthFields the field lengths of the record format identified by the given lookahead symbol. lengths)Defines the format of records identified by a lookahead symbol. |
| public void | addFormatForLookbehind(String
the lookbehind value that when present in the previous output row,
will notify the writer to switch to a new record format, with different field lengths lookbehind, FixedWidthFields the field lengths of the record format identified by the given lookbehind symbol. lengths)Defines the format of records identified by a lookbehind symbol. |
| public final FixedWidthWriterSettings | Returns: a copy of all configurations applied to the current instance.Overrides com. |
| protected final FixedWidthWriterSettings | Returns: a copy of all configurations applied to the current instance.flag indicating whether to clear settings that are likely to be associated with a given input. clearInputSpecificSettings)Overrides com.
Deprecated
doesn't really make sense for fixed-width.
Clones this configuration object to reuse most user-provided settings.
|
| public final FixedWidthWriterSettings | Returns: a copy of the general configurations applied to the current instance.the fixed-width field configuration to be used by the cloned settings object. fields)Clones this configuration object to reuse most user-provided settings. |
| private FixedWidthWriterSettings | |
| protected void | configureFromAnnotations(Class<?>
the classes whose annotations will be processed to derive configurations for writing. beanClass)Overrides com. |
| protected FixedWidthFormat | Returns: and instance of FixedWidthFormat configured to handle Fixed-Width outputsImplements abstract com. |
| pack-priv int[] | Returns: the sequence of field lengths to be written to form a record.Returns the sequence of field lengths to be written to form a record. |
| public FieldAlignment | Returns: the default alignment for headers, ornull if the headers should be aligned according to the column alignment.Returns the default alignment to use when writing headers. |
| pack-priv FieldAlignment[] | Returns: the sequence of field alignments to apply to each field in the record.Returns the sequence of field alignments to apply to each field in the record. |
| pack-priv int[] | Returns: the sequence of field lengths to be written to form a record.Returns the sequence of field lengths to be written to form a record. |
| pack-priv char[] | Returns: the sequence of paddings used by each field of each record.Returns the sequence of paddings used by each field of each record. |
| pack-priv boolean[] | Returns: the sequence of fields to ignore.Returns the sequence of fields to ignore. |
| pack-priv Lookup[] | |
| pack-priv Lookup[] | |
| public int | getMaxColumns()
Overrides com. |
| public boolean | Returns: true if the default padding is to be used when writing headers, otherwise falseIndicates whether headers should be written using the default padding specified in |
| public boolean | Returns: whether the writer should add a line separator after a record is written to the output.Returns a flag indicating whether each record, when written, should be followed by a line separator (as specified in |
| public void | setDefaultAlignmentForHeaders(FieldAlignment
the alignment to use when writing headers. defaultAlignmentForHeaders)null indicates that headers
should be aligned according to the column alignment.Defines the default alignment to use when writing headers. |
| pack-priv final void | |
| public void | setUseDefaultPaddingForHeaders(boolean
flag indicating whether the default padding is to be used when writing headers useDefaultPaddingForHeaders)Defines whether headers should be written using the default padding specified in |
| public void | setWriteLineSeparatorAfterRecord(boolean
flag indicating whether the writer should add a line separator after a record is written to the output. writeLineSeparatorAfterRecord)Defines whether each record, when written, should be followed by a line separator (as specified in |
| defaultAlignmentForHeaders | back to summary |
|---|---|
| private FieldAlignment defaultAlignmentForHeaders | |
| fieldLengths | back to summary |
|---|---|
| private FixedWidthFields fieldLengths | |
| lookaheadFormats | back to summary |
|---|---|
| private Map<String, FixedWidthFields> lookaheadFormats | |
| lookbehindFormats | back to summary |
|---|---|
| private Map<String, FixedWidthFields> lookbehindFormats | |
| useDefaultPaddingForHeaders | back to summary |
|---|---|
| private boolean useDefaultPaddingForHeaders | |
| writeLineSeparatorAfterRecord | back to summary |
|---|---|
| private boolean writeLineSeparatorAfterRecord | |
| FixedWidthWriterSettings | back to summary |
|---|---|
| public FixedWidthWriterSettings(FixedWidthFields fieldLengths) You can only create an instance of this class by providing a definition of the field lengths of each record in the input. This must provided using an instance of
| |
| FixedWidthWriterSettings | back to summary |
|---|---|
| public FixedWidthWriterSettings() Creates a basic configuration object for the Fixed-Width writer with no field length configuration.
This constructor is intended to be used when the record length varies depending of the input row.
Refer to | |
| addConfiguration | back to summary |
|---|---|
| protected void addConfiguration(Map<String, Object> out) Overrides com.
| |
| addFormatForLookahead | back to summary |
|---|---|
| public void addFormatForLookahead(String lookahead, FixedWidthFields lengths) Defines the format of records identified by a lookahead symbol.
| |
| addFormatForLookbehind | back to summary |
|---|---|
| public void addFormatForLookbehind(String lookbehind, FixedWidthFields lengths) Defines the format of records identified by a lookbehind symbol.
| |
| clone | back to summary |
|---|---|
| public final FixedWidthWriterSettings clone() Overrides com. Clones this configuration object to reuse all user-provided settings, including the fixed-width field configuration.
| |
| clone | back to summary |
|---|---|
| protected final FixedWidthWriterSettings clone(boolean clearInputSpecificSettings) Overrides com. Deprecated doesn't really make sense for fixed-width. . Use alternative method Clones this configuration object to reuse most user-provided settings. This includes the fixed-width field configuration, but doesn't include other input-specific settings. This method is meant to be used internally only.
| |
| clone | back to summary |
|---|---|
| public final FixedWidthWriterSettings clone(FixedWidthFields fields) Clones this configuration object to reuse most user-provided settings. Properties that are specific to a given
input (such as header names and selection of fields) will be reset to their defaults.
To obtain a full copy, use
| |
| clone | back to summary |
|---|---|
| private FixedWidthWriterSettings clone(boolean clearInputSpecificSettings, FixedWidthFields fields) | |
| configureFromAnnotations | back to summary |
|---|---|
| protected void configureFromAnnotations(Class<?> beanClass) Overrides com. Doc from com. Configures the writer based on the annotations provided in a given class | |
| createDefaultFormat | back to summary |
|---|---|
| protected FixedWidthFormat createDefaultFormat() Implements abstract com. Returns the default FixedWidthFormat configured to handle Fixed-Width outputs
| |
| getAllLengths | back to summary |
|---|---|
| pack-priv int[] getAllLengths() Returns the sequence of field lengths to be written to form a record.
| |
| getDefaultAlignmentForHeaders | back to summary |
|---|---|
| public FieldAlignment getDefaultAlignmentForHeaders() Returns the default alignment to use when writing headers. If none is specified (i.e.
| |
| getFieldAlignments | back to summary |
|---|---|
| pack-priv FieldAlignment[] getFieldAlignments() Returns the sequence of field alignments to apply to each field in the record.
| |
| getFieldLengths | back to summary |
|---|---|
| pack-priv int[] getFieldLengths() Returns the sequence of field lengths to be written to form a record.
| |
| getFieldPaddings | back to summary |
|---|---|
| pack-priv char[] getFieldPaddings() Returns the sequence of paddings used by each field of each record.
| |
| getFieldsToIgnore | back to summary |
|---|---|
| pack-priv boolean[] getFieldsToIgnore() Returns the sequence of fields to ignore.
| |
| getLookaheadFormats | back to summary |
|---|---|
| pack-priv Lookup[] getLookaheadFormats() | |
| getLookbehindFormats | back to summary |
|---|---|
| pack-priv Lookup[] getLookbehindFormats() | |
| getMaxColumns | back to summary |
|---|---|
| public int getMaxColumns() Overrides com. Doc from com. Returns the hard limit of how many columns a record can have (defaults to 512). You need this to avoid OutOfMemory errors in case of inputs that might be inconsistent with the format you are dealing with .
| |
| getUseDefaultPaddingForHeaders | back to summary |
|---|---|
| public boolean getUseDefaultPaddingForHeaders() Indicates whether headers should be written using the default padding specified in
| |
| getWriteLineSeparatorAfterRecord | back to summary |
|---|---|
| public boolean getWriteLineSeparatorAfterRecord() Returns a flag indicating whether each record, when written, should be followed by a line separator (as specified in
true.
| |
| setDefaultAlignmentForHeaders | back to summary |
|---|---|
| public void setDefaultAlignmentForHeaders(FieldAlignment defaultAlignmentForHeaders) Defines the default alignment to use when writing headers. If none is specified (i.e.
| |
| setFieldLengths | back to summary |
|---|---|
| pack-priv final void setFieldLengths(FixedWidthFields fieldLengths) | |
| setUseDefaultPaddingForHeaders | back to summary |
|---|---|
| public void setUseDefaultPaddingForHeaders(boolean useDefaultPaddingForHeaders) Defines whether headers should be written using the default padding specified in
| |
| setWriteLineSeparatorAfterRecord | back to summary |
|---|---|
| public void setWriteLineSeparatorAfterRecord(boolean writeLineSeparatorAfterRecord) Defines whether each record, when written, should be followed by a line separator (as specified in
true.
| |