public static TypeMappingOption wildcard(final boolean value) { return TypeMappingOptions.wildcard(value); }
public static TypeMappingOption wildcard(final boolean value) { return TypeMappingOptions.wildcard(value); }
@Override protected void configure() { /* * Add the required dozer mappings to map from each field in the supplied class to its associated column (in * the CsvDozerBeanData List). mapNull is enabled so that null field values are added to the List (otherwise * the List would be too short!). oneWay is enabled just in case a custom DozerBeanMapper is supplied (so * the same DozerBeanMapper can be used by CsvDozerBeanReader). wildcard is disabled to prevent Dozer from * trying to map every field in the bean automatically. copyByReference is enabled on the field mapping to * ensure no conversions are performed (bean values are just copied to the List). */ final TypeMappingBuilder mappingBuilder = mapping(clazz, type(CsvDozerBeanData.class).mapNull(true), oneWay(), wildcard(false)); for( int i = 0; i < fieldMapping.length; i++ ) { final String mapping = fieldMapping[i]; if( mapping == null ) { // a null field mapping at end of array results in the List being too short, so don't allow throw new NullPointerException(String.format("fieldMapping at index %d should not be null", i)); } // add a field mapping from the field to the appropriate column in the beanData List mappingBuilder.fields(mapping, "columns[" + i + "]", FieldsMappingOptions.copyByReference()); } } }
final TypeMappingBuilder mappingBuilder = mapping(CsvDozerBeanData.class, clazz, oneWay(), wildcard(false), mapNull(true));