T
- The type of bean being processedpublic class FuzzyMappingStrategy<T> extends HeaderColumnNameMappingStrategy<T>
AbstractMappingStrategy.RecursiveType
fieldMap, forceCorrectRecordLength, writeOrder
errorLocale, headerIndex, profile, recursiveTypeTree, type
Constructor and Description |
---|
FuzzyMappingStrategy()
Nullary constructor.
|
FuzzyMappingStrategy(boolean forceCorrectRecordLength)
Constructor to allow setting options for header name mapping.
|
Modifier and Type | Method and Description |
---|---|
void |
captureHeader(CSVReader reader)
Implementation of this method can grab the header line before parsing
begins to use to map columns to bean properties.
|
protected void |
loadUnadornedFieldMap(org.apache.commons.collections4.ListValuedMap<Class<?>,Field> fields)
This implementation intentionally does nothing in order to allow fuzzy
matching in case there are no annotations at all in the class in
question.
|
getBindingAnnotations, loadAnnotatedFieldMap
chooseMultivaluedFieldIndexFromHeaderIndex, findField, findHeader, getFieldMap, initializeFieldMap, setColumnOrderOnWrite, verifyLineLength
createBean, determineConverter, filterIgnoredFields, generateHeader, getColumnName, getType, ignoreFields, indexBean, instantiateCustomConverter, isForbiddenClassForRecursion, loadFieldMap, loadRecursiveClasses, partitionFields, populateNewBean, selectAnnotationForProfile, setErrorLocale, setFieldValue, setProfile, setType, transmuteBean
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isAnnotationDriven
public FuzzyMappingStrategy()
FuzzyMappingStrategyBuilder
public FuzzyMappingStrategy(boolean forceCorrectRecordLength)
FuzzyMappingStrategyBuilder
.forceCorrectRecordLength
- If set, every record will be shortened
or lengthened to match the number of
headersFuzzyMappingStrategyBuilder
protected void loadUnadornedFieldMap(org.apache.commons.collections4.ListValuedMap<Class<?>,Field> fields)
loadUnadornedFieldMap
in class HeaderNameBaseMappingStrategy<T>
fields
- A list of all non-synthetic fields in the bean to be
processedpublic void captureHeader(CSVReader reader) throws IOException, CsvRequiredFieldEmptyException
MappingStrategy
captureHeader
in interface MappingStrategy<T>
captureHeader
in class HeaderNameBaseMappingStrategy<T>
reader
- The CSVReader to use for header parsingIOException
- If parsing failsCsvRequiredFieldEmptyException
- If a field is required, but the
header or column position for the field is not present in the inputCopyright © 2005–2023. All rights reserved.