Top Description Fields Constructors Methods
com.opencsv.bean

public Class RegexToBeanField<T>

extends AbstractFieldMapEntry<String, String, T>
Class Inheritance
Type Parameters
<T>
The type of the bean being converted
Imports
com.opencsv.bean.util.OpencsvUtils, java.util.Locale, java.util.regex.Matcher, .Pattern

Maps any header name matching a regular expression to a BeanField.
Author
Andrew Rucker Jones
Since
4.2

Field Summary

Modifier and TypeField and Description
private final Pattern
regex

The compiled regular expression used to match header names.

Inherited from com.opencsv.bean.AbstractFieldMapEntry:
errorLocalefield

Constructor Summary

AccessConstructor and Description
public
RegexToBeanField(final String
A valid regular expression against which potential header names are matched
pattern
,
final BeanField<T, String>
The BeanField this mapping maps to
field
,
final Locale
The locale for error messages
errorLocale
)

Initializes this mapping with the regular expression used to map header names and the BeanField they should be mapped to.

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(String key)

Implements com.opencsv.bean.ComplexFieldMapEntry.contains.

Determines whether or not the given key is contained in this entry.

public String
getInitializer()

Implements com.opencsv.bean.ComplexFieldMapEntry.getInitializer.

Returns the information used to initialize this entry.

Inherited from com.opencsv.bean.AbstractFieldMapEntry:
getBeanFieldsetErrorLocale

Field Detail

regexback to summary
private final Pattern regex

The compiled regular expression used to match header names.

Constructor Detail

RegexToBeanFieldback to summary
public RegexToBeanField(final String pattern, final BeanField<T, String> field, final Locale errorLocale)

Initializes this mapping with the regular expression used to map header names and the BeanField they should be mapped to.

Parameters
pattern:String

A valid regular expression against which potential header names are matched

field:BeanField<T, String>

The BeanField this mapping maps to

errorLocale:Locale

The locale for error messages

Method Detail

containsback to summary
public boolean contains(String key)

Implements com.opencsv.bean.ComplexFieldMapEntry.contains.

Doc from com.opencsv.bean.ComplexFieldMapEntry.contains.

Determines whether or not the given key is contained in this entry.

Annotations
@Override
getInitializerback to summary
public String getInitializer()

Implements com.opencsv.bean.ComplexFieldMapEntry.getInitializer.

Doc from com.opencsv.bean.ComplexFieldMapEntry.getInitializer.

Returns the information used to initialize this entry. This information is not guaranteed to be exactly the same as the original value, but is functionally equivalent.

Annotations
@Override