@Retention(value=RUNTIME) @Target(value={FIELD,METHOD}) public @interface CsvColumn
NOTE: When using on a get/is/set methods you need to add this annotation to both the get/is and the set methods. Also, you need to make sure that the CsvColumn annotation fields are the same on both the get/is and set methods.
Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT_VALUE
Used internally to detect whether or not a value has been configured.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
afterColumn
Used to set the order of the columns by setting the column-name that this column comes after.
|
String |
columnName
This allows you to override and set a column name.
|
Class<? extends Converter<?,?>> |
converterClass
Sets the converter to use to convert this column if you don't want to use the default appropriate internal class.
|
long |
converterFlags
Optional flags for the converter which adjust the output.
|
String |
defaultValue
Set this to a default string for the column.
|
String |
format
Sets the format for this column.
|
boolean |
mustBeSupplied
Set to false if a column is optional and can be skipped in the input altogether.
|
boolean |
mustNotBeBlank
Set to true if a value in the column cannot be empty when it is being read in and a parse error or exception will
be generated.
|
boolean |
trimInput
Set to true if you want the column read from the line to be trimmed (using
String.trim() ) before it is
converted to Java. |
public static final String DEFAULT_VALUE
public abstract String columnName
public abstract boolean mustNotBeBlank
public abstract boolean trimInput
String.trim()
) before it is
converted to Java. This may not be applicable to all column types.public abstract String format
DecimalFormat
class is used to override for numbers.public abstract long converterFlags
@CsvColumn(converterFlags = XxxConverter.FLAG1 + XxxConverter.FLAG2) private Xxx dollarAmount;
public abstract Class<? extends Converter<?,?>> converterClass
CsvProcessor.registerConverter(Class, Converter)
. This converter class
must have a public no-arg constructor.public abstract String defaultValue
public abstract boolean mustBeSupplied
public abstract String afterColumn
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.