org.apache.commons.collections4.MultiValuedMap in use
| Modifier and Type | Field and Description |
|---|---|
| private final Class | mapType
The type of the |
| Access | Constructor and Description |
|---|---|
| public | BeanFieldJoin(Class<?>
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. type, Field The bean field this object represents field, boolean Whether or not a value is always required for this field required, Locale The locale to use for error messages errorLocale, CsvConverter The converter to be used for performing the data
conversion on reading or writing converter, Class<? extends MultiValuedMap<K, V>> The type of the
mapType, String capture, String org. that should be
instantiated for the bean field being populatedThe format string used for packaging values to be written.
If format)null or empty, it is ignored.Creates a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | assignValueToField(Object bean, Object obj, String header)
Overrides com. Assigns the value given to the proper field of the bean given. |
| public Object[] | Returns: An array of all objects in theorg. addressed by
this bean field answering to the key given in indexOverrides com. Implements com. Given the value of a bean field and an index into that value, determine what values need to be written. |
| protected boolean | isFieldEmptyForWrite(Object value)
Overrides com. Checks that |
| protected abstract Object | Returns: The previous value under this index, or null if there was no previous valueThe map to which to assign the new value. Never null. map, String The index under which the new value should be placed in the
map. Never null. index, Object The new value to be put in the map newValue)Puts the value given in |
| mapType | back to summary |
|---|---|
| private final Class<? extends MultiValuedMap<K, V>> mapType The type of the | |
| BeanFieldJoin | back to summary |
|---|---|
| public BeanFieldJoin(Class<?> type, Field field, boolean required, Locale errorLocale, CsvConverter converter, Class<? extends MultiValuedMap<K, V>> mapType, String capture, String format) Creates a new instance.
| |
| assignValueToField | back to summary |
|---|---|
| protected void assignValueToField(Object bean, Object obj, String header) throws CsvDataTypeMismatchException Overrides com. Assigns the value given to the proper field of the bean given. In the case of this kind of bean field, the new value will be added to an existing map, and a new map will be created if one does not already exist.
| |
| indexAndSplitMultivaluedField | back to summary |
|---|---|
| public Object[] indexAndSplitMultivaluedField(Object value, I index) throws CsvDataTypeMismatchException Overrides com. Implements com. Doc from com. Given the value of a bean field and an index into that value, determine what values need to be written. When writing a bean to a CSV file, some single fields from the bean could have values that need to be split into multiple fields when writing them to the CSV file. Given the value of the bean field and an index into the data, this method returns the objects to be converted and written.
| |
| isFieldEmptyForWrite | back to summary |
|---|---|
| protected boolean isFieldEmptyForWrite(Object value) Overrides com. Checks that
| |
| putNewValue | back to summary |
|---|---|
| protected abstract Object putNewValue(MultiValuedMap<I, Object> map, String index, Object newValue) Puts the value given in
| |