Package com.opencsv.bean
Class RegexToBeanField<T>
- java.lang.Object
-
- com.opencsv.bean.AbstractFieldMapEntry<java.lang.String,java.lang.String,T>
-
- com.opencsv.bean.RegexToBeanField<T>
-
- Type Parameters:
T
- The type of the bean being converted
- All Implemented Interfaces:
ComplexFieldMapEntry<java.lang.String,java.lang.String,T>
public class RegexToBeanField<T> extends AbstractFieldMapEntry<java.lang.String,java.lang.String,T>
Maps any header name matching a regular expression to aBeanField
.- Since:
- 4.2
- Author:
- Andrew Rucker Jones
-
-
Field Summary
-
Fields inherited from class com.opencsv.bean.AbstractFieldMapEntry
errorLocale, field
-
-
Constructor Summary
Constructors Constructor Description RegexToBeanField(java.lang.String pattern, BeanField<T,java.lang.String> field, java.util.Locale errorLocale)
Initializes this mapping with the regular expression used to map header names and theBeanField
they should be mapped to.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.String key)
Determines whether or not the given key is contained in this entry.java.lang.String
getInitializer()
Returns the information used to initialize this entry.-
Methods inherited from class com.opencsv.bean.AbstractFieldMapEntry
getBeanField, setErrorLocale
-
-
-
-
Constructor Detail
-
RegexToBeanField
public RegexToBeanField(java.lang.String pattern, BeanField<T,java.lang.String> field, java.util.Locale errorLocale)
Initializes this mapping with the regular expression used to map header names and theBeanField
they should be mapped to.- Parameters:
pattern
- A valid regular expression against which potential header names are matchedfield
- TheBeanField
this mapping maps toerrorLocale
- The locale for error messages
-
-
Method Detail
-
contains
public boolean contains(java.lang.String key)
Description copied from interface:ComplexFieldMapEntry
Determines whether or not the given key is contained in this entry.- Parameters:
key
- The key to be located- Returns:
- Whether
key
is represented by this entry
-
getInitializer
public java.lang.String getInitializer()
Description copied from interface:ComplexFieldMapEntry
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.- Returns:
- The original information used to initialize this mapping entry
-
-