Package com.opencsv.bean
Class AbstractFieldMap<I,K extends Comparable<K>,C extends ComplexFieldMapEntry<I,K,T>,T>
java.lang.Object
com.opencsv.bean.AbstractFieldMap<I,K,C,T>
- Type Parameters:
I
- The initializer type used to build the many-to-one mappingK
- Type of the field identifier (key)C
- Type of the ComplexFieldMapEntry usedT
- Type of the bean being converted
- All Implemented Interfaces:
FieldMap<I,
K, C, T>
- Direct Known Subclasses:
FieldMapByName
,FieldMapByPosition
public abstract class AbstractFieldMap<I,K extends Comparable<K>,C extends ComplexFieldMapEntry<I,K,T>,T>
extends Object
implements FieldMap<I,K,C,T>
A base class to collect all generalized components of a
FieldMap
.
May be used by all as a base class for their own implementations of
FieldMap
.- Since:
- 4.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractFieldMap
(Locale errorLocale) Initializes thisFieldMap
. -
Method Summary
Modifier and TypeMethodDescriptionGets theBeanField
associated with this key.Associates the givenBeanField
with the givenkey
.void
setErrorLocale
(Locale errorLocale) Sets the locale to be used for error messages.values()
Provides all values currently in the map.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.opencsv.bean.FieldMap
generateHeader, putComplex
-
Field Details
-
Constructor Details
-
AbstractFieldMap
Initializes thisFieldMap
.- Parameters:
errorLocale
- The locale to be used for error messages
-
-
Method Details
-
get
Description copied from interface:FieldMap
Gets theBeanField
associated with this key. If a key could possibly match both a regular, simple key (one added withFieldMap.put(Comparable, BeanField)
), and a complex key (one added withFieldMap.putComplex(java.lang.Object, com.opencsv.bean.BeanField)
), the simple key is always matched. If a key could match more than one complex key, the return value is undefined. -
put
Description copied from interface:FieldMap
Associates the givenBeanField
with the givenkey
. -
values
Description copied from interface:FieldMap
Provides all values currently in the map. -
setErrorLocale
Description copied from interface:FieldMap
Sets the locale to be used for error messages.- Specified by:
setErrorLocale
in interfaceFieldMap<I,
K extends Comparable<K>, C extends ComplexFieldMapEntry<I, K, T>, T> - Parameters:
errorLocale
- The locale to be used for error messages
-