Package com.opencsv.bean
Class BeanFieldJoinStringIndex<T>
java.lang.Object
com.opencsv.bean.AbstractBeanField<T,String>
com.opencsv.bean.BeanFieldSingleValue<T,String>
com.opencsv.bean.BeanFieldJoin<T,String>
com.opencsv.bean.BeanFieldJoinStringIndex<T>
- Type Parameters:
T
- The type of the bean being populated
Implements a
BeanFieldJoin
with a String
for an
index.- Since:
- 4.2
-
Field Summary
Fields inherited from class com.opencsv.bean.BeanFieldSingleValue
capture, writeFormat
Fields inherited from class com.opencsv.bean.AbstractBeanField
converter, errorLocale, field, fieldAccess, required, type
-
Constructor Summary
ConstructorsConstructorDescriptionBeanFieldJoinStringIndex
(Class<?> type, Field field, boolean required, Locale errorLocale, CsvConverter converter, Class<? extends org.apache.commons.collections4.MultiValuedMap> mapType, String capture, String format) Creates a new instance. -
Method Summary
Methods inherited from class com.opencsv.bean.BeanFieldJoin
assignValueToField, indexAndSplitMultivaluedField, isFieldEmptyForWrite
Methods inherited from class com.opencsv.bean.BeanFieldSingleValue
convert, convertToWrite
Methods inherited from class com.opencsv.bean.AbstractBeanField
getErrorLocale, getField, getFieldValue, getType, isRequired, setErrorLocale, setField, setFieldValue, setRequired, setType, write
-
Constructor Details
-
BeanFieldJoinStringIndex
public BeanFieldJoinStringIndex(Class<?> type, Field field, boolean required, Locale errorLocale, CsvConverter converter, Class<? extends org.apache.commons.collections4.MultiValuedMap> mapType, String capture, String format) Creates a new instance.- Parameters:
type
- The type of the class in which this field is found. This is the type as instantiated by opencsv, and not necessarily the type in which the field is declared in the case of inheritance.field
- The bean field this object representsrequired
- Whether or not a value is always required for this fielderrorLocale
- The locale to use for error messagesconverter
- The converter to be used for performing the data conversion on reading or writingmapType
- The type of theMultiValuedMap
that should be instantiated for the bean field being populatedcapture
- SeeCsvBindAndJoinByName.capture()
format
- The format string used for packaging values to be written. Ifnull
or empty, it is ignored.
-
-
Method Details
-
putNewValue
protected Object putNewValue(org.apache.commons.collections4.MultiValuedMap<String, Object> map, String index, Object newValue) Description copied from class:BeanFieldJoin
Puts the value given innewValue
intomap
usingindex
. This allows derived classes to do something special before assigning the value, such as converting the index to a different type.- Specified by:
putNewValue
in classBeanFieldJoin<T,
String> - Parameters:
map
- The map to which to assign the new value. Never null.index
- The index under which the new value should be placed in the map. Never null.newValue
- The new value to be put in the map- Returns:
- The previous value under this index, or null if there was no previous value
-