AbstractWriter)
By default, all writers work with, at least, the following configuration options in addition to the ones provided by CommonSettings:
RowWriterProcessor which processes input objects into a manageable format for writing.com.univocity.parsers.common.processor.RowWriterProcessor , com.univocity.parsers.csv.CsvWriterSettings , com.univocity.parsers.fixed.FixedWidthWriterSettings
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String | |
| private boolean | |
| private Boolean | |
| private RowWriterProcessor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected void | clearInputSpecificSettings()
Overrides com. |
| protected CommonWriterSettings | clone(boolean
flag indicating whether to clear settings that are likely to be associated with a given input. clearInputSpecificSettings)Overrides com. |
| protected CommonWriterSettings | clone()
Overrides com. |
| protected void | configureFromAnnotations(Class<?>
the classes whose annotations will be processed to derive configurations for writing. beanClass)Configures the writer based on the annotations provided in a given class |
| public String | Returns: the String representation of an empty valueReturns the String representation of an empty value (defaults to null) When writing, if the writer has an empty String to write to the output, the emptyValue is used instead of an empty string |
| public final boolean | Returns: a flag indicating whether records with less columns than the number of headers are to be expanded with nulls.Indicates whether the writer should expand records with less columns than the number of headers. |
| public RowWriterProcessor | Returns: the implementation of the interfaceRowWriterProcessor which processes input objects into a manageable format for writing.Returns the implementation of the interface |
| public boolean | Returns: true if the selected fields should be reordered when writing with field selection enabled, false otherwiseIndicates whether fields selected using the field selection methods (defined by the parent class |
| public final boolean | Returns: returnstrue if automatic header writing is enabled, otherwise false.Returns a flag indicating whether automatic writing of headers is enabled. |
| pack-priv final void | |
| public void | setColumnReorderingEnabled(boolean
the flag indicating whether or not selected fields should be reordered and written by the writer columnReorderingEnabled)Defines whether fields selected using the field selection methods (defined by the parent class |
| public void | setEmptyValue(String
the String representation of an empty value emptyValue)Sets the String representation of an empty value (defaults to null) If the writer has an empty String to write to the output, the emptyValue is used instead of an empty string |
| public final void | setExpandIncompleteRows(boolean
a flag indicating whether records with less columns than the number of headers are to be expanded with nulls. expandIncompleteRows)Defines whether the writer should expand records with less columns than the number of headers. |
| public final void | setHeaderWritingEnabled(boolean
a flag to enable or disable automatic header writing. headerWritingEnabled)Enables automatic writing of headers when they are available. |
| public void | setRowWriterProcessor(RowWriterProcessor<?>
the implementation of the interface rowWriterProcessor)RowWriterProcessor which processes input objects into a manageable format for writing.Defines a processor for input objects that converts them into a manageable format for writing. |
| columnReorderingEnabled | back to summary |
|---|---|
| private boolean columnReorderingEnabled | |
| emptyValue | back to summary |
|---|---|
| private String emptyValue | |
| expandIncompleteRows | back to summary |
|---|---|
| private boolean expandIncompleteRows | |
| headerWritingEnabled | back to summary |
|---|---|
| private Boolean headerWritingEnabled | |
| rowWriterProcessor | back to summary |
|---|---|
| private RowWriterProcessor<?> rowWriterProcessor | |
| CommonWriterSettings | back to summary |
|---|---|
| public CommonWriterSettings() | |
| addConfiguration | back to summary |
|---|---|
| protected void addConfiguration(Map<String, Object> out) Overrides com.
| |
| clearInputSpecificSettings | back to summary |
|---|---|
| protected void clearInputSpecificSettings() Overrides com. Doc from com. Clears settings that are likely to be specific to a given input.
| |
| clone | back to summary |
|---|---|
| protected CommonWriterSettings Overrides com. Doc from com. Clones this configuration object to reuse user-provided settings.
Properties that are specific to a given input (such as header names and selection of fields) can be reset to their defaults
if the
| |
| clone | back to summary |
|---|---|
| protected CommonWriterSettings Overrides com. Doc from com. Clones this configuration object. Use alternative
| |
| configureFromAnnotations | back to summary |
|---|---|
| protected void configureFromAnnotations(Class<?> beanClass) Configures the writer based on the annotations provided in a given class
| |
| getEmptyValue | back to summary |
|---|---|
| public String getEmptyValue() Returns the String representation of an empty value (defaults to null) When writing, if the writer has an empty String to write to the output, the emptyValue is used instead of an empty string
| |
| getExpandIncompleteRows | back to summary |
|---|---|
| public final boolean getExpandIncompleteRows() Indicates whether the writer should expand records with less columns than the number of headers. For example, if
the writer is using "A,B,C" as the headers, and the user provides a row with "V1,V2", then Defaults to
| |
| getRowWriterProcessor | back to summary |
|---|---|
| public RowWriterProcessor Returns the implementation of the interface
| |
| isColumnReorderingEnabled | back to summary |
|---|---|
| public boolean isColumnReorderingEnabled() Indicates whether fields selected using the field selection methods (defined by the parent class When disabled, each written record will contain values for all columns, in the order they are sent to the writer. Fields which were not selected will not be written but and the record will contain empty values. When enabled, each written record will contain values only for the selected columns. The values will be ordered according to the selection.
| |
| isHeaderWritingEnabled | back to summary |
|---|---|
| public final boolean isHeaderWritingEnabled() Returns a flag indicating whether automatic writing of headers is enabled. If enabled, and headers are defined (or derived automatically if Defaults to
| |
| runAutomaticConfiguration | back to summary |
|---|---|
| pack-priv final void runAutomaticConfiguration() Overrides com.
| |
| setColumnReorderingEnabled | back to summary |
|---|---|
| public void setColumnReorderingEnabled(boolean columnReorderingEnabled) Defines whether fields selected using the field selection methods (defined by the parent class When disabled, each written record will contain values for all columns, in the order they are sent to the writer. Fields which were not selected will not be written but and the record will contain empty values. When enabled, each written record will contain values only for the selected columns. The values will be ordered according to the selection.
| |
| setEmptyValue | back to summary |
|---|---|
| public void setEmptyValue(String emptyValue) Sets the String representation of an empty value (defaults to null) If the writer has an empty String to write to the output, the emptyValue is used instead of an empty string
| |
| setExpandIncompleteRows | back to summary |
|---|---|
| public final void setExpandIncompleteRows(boolean expandIncompleteRows) Defines whether the writer should expand records with less columns than the number of headers.
For example, if the writer is using "A,B,C" as the headers, and the user provides a row with "V1,V2", then Defaults to
| |
| setHeaderWritingEnabled | back to summary |
|---|---|
| public final void setHeaderWritingEnabled(boolean headerWritingEnabled) Enables automatic writing of headers when they are available. If enabled, and headers are defined (or derived automatically if Defaults to
| |
| setRowWriterProcessor | back to summary |
|---|---|
| public void setRowWriterProcessor(RowWriterProcessor<?> rowWriterProcessor) Defines a processor for input objects that converts them into a manageable format for writing.
| |