Package com.opencsv.bean
Class BeanFieldJoinIntegerIndex<T>
- java.lang.Object
-
- com.opencsv.bean.AbstractBeanField<T,I>
-
- com.opencsv.bean.BeanFieldSingleValue<T,I>
-
- com.opencsv.bean.BeanFieldJoin<T,java.lang.Integer>
-
- com.opencsv.bean.BeanFieldJoinIntegerIndex<T>
-
- Type Parameters:
T
- The type of the bean being populated
- All Implemented Interfaces:
BeanField<T,java.lang.Integer>
public class BeanFieldJoinIntegerIndex<T> extends BeanFieldJoin<T,java.lang.Integer>
Implements aBeanFieldJoin
with aInteger
for an index.- Since:
- 4.2
- Author:
- Andrew Rucker Jones
-
-
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
Constructors Constructor Description BeanFieldJoinIntegerIndex(java.lang.Class<?> type, java.lang.reflect.Field field, boolean required, java.util.Locale errorLocale, CsvConverter converter, java.lang.Class<? extends org.apache.commons.collections4.MultiValuedMap> mapType, java.lang.String capture, java.lang.String format)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
putNewValue(org.apache.commons.collections4.MultiValuedMap<java.lang.Integer,java.lang.Object> map, java.lang.String index, java.lang.Object newValue)
Puts the value given innewValue
intomap
usingindex
.-
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 Detail
-
BeanFieldJoinIntegerIndex
public BeanFieldJoinIntegerIndex(java.lang.Class<?> type, java.lang.reflect.Field field, boolean required, java.util.Locale errorLocale, CsvConverter converter, java.lang.Class<? extends org.apache.commons.collections4.MultiValuedMap> mapType, java.lang.String capture, java.lang.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 Detail
-
putNewValue
protected java.lang.Object putNewValue(org.apache.commons.collections4.MultiValuedMap<java.lang.Integer,java.lang.Object> map, java.lang.String index, java.lang.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,java.lang.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
-
-