T
- The type of the beanpublic class BeanFieldPrimitiveTypes<T> extends AbstractBeanField<T>
field, required
Constructor and Description |
---|
BeanFieldPrimitiveTypes(Field field,
boolean required,
String locale) |
Modifier and Type | Method and Description |
---|---|
protected Object |
convert(String value)
Method for converting from a string to the proper datatype of the
destination field.
|
protected String |
convertToWrite(Object value)
This method takes the current value of the field in question in the bean
passed in and converts it to a string.
|
getField, isRequired, setField, setFieldValue, setRequired, write
public BeanFieldPrimitiveTypes(Field field, boolean required, String locale)
field
- A Field
objectrequired
- True if the field is required to contain a value, false
if it is allowed to be null or a blank stringlocale
- If not null or empty, specifies the locale used for
converting locale-specific data typesprotected Object convert(String value) throws CsvDataTypeMismatchException
AbstractBeanField
convert
in class AbstractBeanField<T>
value
- The string from the selected field of the CSV fileObject
representing the input data converted
into the proper typeCsvDataTypeMismatchException
- If the input string cannot be converted into
the proper typeprotected String convertToWrite(Object value) throws CsvDataTypeMismatchException
String
, BigDecimal
, and
BigInteger
.convertToWrite
in class AbstractBeanField<T>
value
- The contents of the field currently being processed from the
bean to be written. Can be null.value
is nullCsvDataTypeMismatchException
- If there is an error converting
value to a stringAbstractBeanField.write(java.lang.Object)
Copyright © 2017. All rights reserved.