Package com.opencsv.bean
Class RegexToBeanField<T>
- Type Parameters:
T
- The type of the bean being converted
- All Implemented Interfaces:
ComplexFieldMapEntry<String,
String, T>
Maps any header name matching a regular expression to a
BeanField
.- Since:
- 4.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pattern
The compiled regular expression used to match header names.Fields inherited from class com.opencsv.bean.AbstractFieldMapEntry
errorLocale, field
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether or not the given key is contained in this entry.Returns the information used to initialize this entry.Methods inherited from class com.opencsv.bean.AbstractFieldMapEntry
getBeanField, setErrorLocale
-
Field Details
-
regex
The compiled regular expression used to match header names.
-
-
Constructor Details
-
RegexToBeanField
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 Details
-
contains
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
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
-