Top Description Fields Constructors Methods
com.opencsv.bean

public abstract Class AbstractFieldMap<I, K extends Comparable<K>, C extends ComplexFieldMapEntry<I, K, T>, T>

extends Object
implements FieldMap<I, K extends Comparable<K>, C extends ComplexFieldMapEntry<I, K, T>, T>
Class Inheritance
All Implemented Interfaces
com.opencsv.bean.FieldMap
Known Direct Subclasses
com.opencsv.bean.FieldMapByName, com.opencsv.bean.FieldMapByPosition
Type Parameters
<I>
The initializer type used to build the many-to-one mapping
<K>
Type of the field identifier (key)
<C>
Type of the ComplexFieldMapEntry used
<T>
Type of the bean being converted
Imports
java.util.ArrayList, .Collection, .List, .Locale, .SortedMap, .TreeMap, org.apache.commons.lang3.ObjectUtils

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.
Author
Andrew Rucker Jones
Since
4.2

Field Summary

Modifier and TypeField and Description
protected final List<C>
complexMapList

A list of entries representing all complex, that is many-to-one, mappings represented in this FieldMap.

protected Locale
errorLocale

The locale for error messages.

protected final SortedMap<K, BeanField<T, K>>
simpleMap

A map for all simple, that is one-to-one, mappings represented in this FieldMap.

Constructor Summary

AccessConstructor and Description
protected
AbstractFieldMap(final Locale
The locale to be used for error messages
errorLocale
)

Initializes this FieldMap.

Method Summary

Modifier and TypeMethod and Description
public BeanField<T, K>
get(final K key)

Implements com.opencsv.bean.FieldMap.get.

Gets the BeanField associated with this key.

public BeanField<T, K>
put(final K key, final BeanField<T, K> value)

Implements com.opencsv.bean.FieldMap.put.

Associates the given BeanField with the given key.

public void
setErrorLocale(final Locale errorLocale)

Implements com.opencsv.bean.FieldMap.setErrorLocale.

Sets the locale to be used for error messages.

public Collection<BeanField<T, K>>
values()

Implements com.opencsv.bean.FieldMap.values.

Provides all values currently in the map.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

complexMapListback to summary
protected final List<C> complexMapList

A list of entries representing all complex, that is many-to-one, mappings represented in this FieldMap.

errorLocaleback to summary
protected Locale errorLocale

The locale for error messages.

simpleMapback to summary
protected final SortedMap<K, BeanField<T, K>> simpleMap

A map for all simple, that is one-to-one, mappings represented in this FieldMap.

Constructor Detail

AbstractFieldMapback to summary
protected AbstractFieldMap(final Locale errorLocale)

Initializes this FieldMap.

Parameters
errorLocale:Locale

The locale to be used for error messages

Method Detail

getback to summary
public BeanField<T, K> get(final K key)

Implements com.opencsv.bean.FieldMap.get.

Doc from com.opencsv.bean.FieldMap.get.

Gets the BeanField associated with this key. If a key could possibly match both a regular, simple key (one added with put(Comparable, BeanField)), and a complex key (one added with 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.

Annotations
@Override
putback to summary
public BeanField<T, K> put(final K key, final BeanField<T, K> value)

Implements com.opencsv.bean.FieldMap.put.

Doc from com.opencsv.bean.FieldMap.put.

Associates the given BeanField with the given key.

Annotations
@Override
setErrorLocaleback to summary
public void setErrorLocale(final Locale errorLocale)

Implements com.opencsv.bean.FieldMap.setErrorLocale.

Doc from com.opencsv.bean.FieldMap.setErrorLocale.

Sets the locale to be used for error messages.

Annotations
@Override
valuesback to summary
public Collection<BeanField<T, K>> values()

Implements com.opencsv.bean.FieldMap.values.

Doc from com.opencsv.bean.FieldMap.values.

Provides all values currently in the map.

Annotations
@Override