T
- The type of the column whose information we are storing in here.public class ColumnInfo<T> extends Object
Modifier and Type | Method and Description |
---|---|
static <T> ColumnInfo<T> |
forTests(Converter<T,?> converter,
Class<?> type,
String format,
long converterFlags)
For testing purposes.
|
static <T> ColumnInfo<T> |
fromAnnotation(CsvColumn csvColumn,
String fieldName,
Class<T> type,
Field field,
Method getMethod,
Method setMethod,
Converter<T,?> converter)
Make a column-info instance from a Java Field.
|
static <T> ColumnInfo<T> |
fromAnnotation(CsvField csvField,
String fieldName,
Class<T> type,
Field field,
Method getMethod,
Method setMethod,
Converter<T,?> converter)
Make a column-info instance from a Java Field.
|
String |
getAfterColumn()
Column name that we come after to have the order not be field or method position based.
|
String |
getColumnName()
Returns the header name for this column.
|
Object |
getConfigInfo()
Returns the configuration information associated with the column, if any.
|
Converter<T,?> |
getConverter()
Returns the converter class associated with the column.
|
String |
getDefaultValue()
Returns the default string for the column or null if none.
|
Field |
getField()
Associated reflection field or null if using get/set method.
|
String |
getFieldName()
Name of the java field or the get/set methods.
|
Method |
getGetMethod()
Associated reflection get/is method or null if using field.
|
int |
getPosition()
Returns the position the column appears in the file.
|
Method |
getSetMethod()
Associated reflection set method or null if using field.
|
Class<T> |
getType() |
T |
getValue(Object obj)
Get the value associated with this field from the object parameter either by getting from the field or calling
the get method.
|
boolean |
isMustBeSupplied()
Returns whether the column is optional or not.
|
boolean |
isMustNotBeBlank()
Returns whether this column is required.
|
boolean |
isNeedsQuotes()
Returns whether this column should be surrounded by quotes or not.
|
boolean |
isTrimInput()
Returns whether this column should be trimmed when read.
|
void |
setPosition(int position)
Set the position the column appears in the file.
|
void |
setValue(Object obj,
T value)
Set the value associated with this field from the object parameter either by setting via the field or calling the
set method.
|
String |
toString() |
public T getValue(Object obj) throws IllegalAccessException, InvocationTargetException
public void setValue(Object obj, T value) throws IllegalAccessException, InvocationTargetException
public String getFieldName()
public Field getField()
public Method getGetMethod()
public Method getSetMethod()
public Converter<T,?> getConverter()
public Object getConfigInfo()
public String getColumnName()
CsvColumn.columnName()
public int getPosition()
public void setPosition(int position)
public boolean isMustNotBeBlank()
CsvColumn.mustNotBeBlank()
public boolean isTrimInput()
CsvColumn.trimInput()
public boolean isNeedsQuotes()
public String getDefaultValue()
CsvColumn.defaultValue()
public boolean isMustBeSupplied()
CsvColumn.mustBeSupplied()
public String getAfterColumn()
CsvColumn.afterColumn()
public static <T> ColumnInfo<T> fromAnnotation(CsvColumn csvColumn, String fieldName, Class<T> type, Field field, Method getMethod, Method setMethod, Converter<T,?> converter)
public static <T> ColumnInfo<T> fromAnnotation(CsvField csvField, String fieldName, Class<T> type, Field field, Method getMethod, Method setMethod, Converter<T,?> converter)
public static <T> ColumnInfo<T> forTests(Converter<T,?> converter, Class<?> type, String format, long converterFlags)
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.