Package com.opencsv.bean
Class BeanFieldJoinIntegerIndex<T>
java.lang.Object
com.opencsv.bean.AbstractBeanField<T,Integer>
com.opencsv.bean.BeanFieldSingleValue<T,Integer>
com.opencsv.bean.BeanFieldJoin<T,Integer>
com.opencsv.bean.BeanFieldJoinIntegerIndex<T>
- Type Parameters:
T- The type of the bean being populated
Implements a
BeanFieldJoin with a Integer for an
index.- Since:
- 4.2
-
Field Summary
Fields inherited from class com.opencsv.bean.BeanFieldSingleValue
capture, writeFormatFields inherited from class com.opencsv.bean.AbstractBeanField
converter, errorLocale, field, fieldAccess, required, type -
Constructor Summary
ConstructorsConstructorDescriptionBeanFieldJoinIntegerIndex(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, isFieldEmptyForWriteMethods inherited from class com.opencsv.bean.BeanFieldSingleValue
convert, convertToWriteMethods inherited from class com.opencsv.bean.AbstractBeanField
getErrorLocale, getField, getFieldValue, getType, isRequired, setErrorLocale, setField, setFieldValue, setRequired, setType, write
-
Constructor Details
-
BeanFieldJoinIntegerIndex
public BeanFieldJoinIntegerIndex(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 theMultiValuedMapthat should be instantiated for the bean field being populatedcapture- SeeCsvBindAndJoinByName.capture()format- The format string used for packaging values to be written. Ifnullor empty, it is ignored.
-
-
Method Details
-
putNewValue
protected Object putNewValue(org.apache.commons.collections4.MultiValuedMap<Integer, Object> map, String index, Object newValue) Description copied from class:BeanFieldJoinPuts the value given innewValueintomapusingindex. This allows derived classes to do something special before assigning the value, such as converting the index to a different type.- Specified by:
putNewValuein classBeanFieldJoin<T,Integer> - 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
-