Class FuzzyMappingStrategy<T>

  • Type Parameters:
    T - The type of bean being processed
    All Implemented Interfaces:
    MappingStrategy<T>

    public class FuzzyMappingStrategy<T>
    extends HeaderColumnNameMappingStrategy<T>
    A mapping strategy that tries to make the best match between header names and non-annotated member variables.
    Since:
    5.0
    • Constructor Detail

      • FuzzyMappingStrategy

        public FuzzyMappingStrategy​(boolean forceCorrectRecordLength)
        Constructor to allow setting options for header name mapping. Not considered stable. As new options are introduced for the mapping strategy, they will be introduced here. You are encouraged to use FuzzyMappingStrategyBuilder.
        Parameters:
        forceCorrectRecordLength - If set, every record will be shortened or lengthened to match the number of headers
        See Also:
        FuzzyMappingStrategyBuilder
    • Method Detail

      • loadUnadornedFieldMap

        protected void loadUnadornedFieldMap​(org.apache.commons.collections4.ListValuedMap<java.lang.Class<?>,​java.lang.reflect.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.
        Overrides:
        loadUnadornedFieldMap in class HeaderNameBaseMappingStrategy<T>
        Parameters:
        fields - A list of all non-synthetic fields in the bean to be processed