java.lang.Object
org.simpleflatmapper.map.mapper.AbstractMapperFactory<K,MF,S>
org.simpleflatmapper.map.mapper.AbstractColumnNameDiscriminatorMapperFactory<CsvColumnKey,CsvMapperFactory,CsvRow>
org.simpleflatmapper.csv.CsvMapperFactory
public final class CsvMapperFactory
extends org.simpleflatmapper.map.mapper.AbstractColumnNameDiscriminatorMapperFactory<CsvColumnKey,CsvMapperFactory,CsvRow>
CsvMapperFactory is not Thread-Safe but the mappers are.
It is strongly advised to instantiate one jdbcMapper per class for the life of your application.
You can instantiate dynamic jdbcMapper which will use the name line of the csv file to figure out the list of the columns or a static one using a builder.
// create a dynamic jdbcMapper targeting MyClass
CsvMapperFactory
.newInstance()
.newMapper(MyClass.class);
// create a static jdbcMapper targeting MyClass
CsvMapperFactory
.newInstance()
.newBuilder(MyClass.class)
.addMapping("id")
.addMapping("field1")
.addMapping("field2")
.mapper();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.simpleflatmapper.map.mapper.AbstractColumnNameDiscriminatorMapperFactory
org.simpleflatmapper.map.mapper.AbstractColumnNameDiscriminatorMapperFactory.DiscriminatorNamedGetter<S,T>, org.simpleflatmapper.map.mapper.AbstractColumnNameDiscriminatorMapperFactory.DiscriminatorNamedGetterFactory<S> Nested classes/interfaces inherited from class org.simpleflatmapper.map.mapper.AbstractMapperFactory
org.simpleflatmapper.map.mapper.AbstractMapperFactory.DiscriminatorBuilder<S,K extends org.simpleflatmapper.map.FieldKey<K>, T>, org.simpleflatmapper.map.mapper.AbstractMapperFactory.DiscriminatorConditionBuilder<S, K extends org.simpleflatmapper.map.FieldKey<K>, KT, T>, org.simpleflatmapper.map.mapper.AbstractMapperFactory.DiscriminatorDSL<K extends org.simpleflatmapper.map.FieldKey<K>, MF extends org.simpleflatmapper.map.mapper.AbstractMapperFactory<K, MF, S>, S, T>, org.simpleflatmapper.map.mapper.AbstractMapperFactory.DiscriminatorOnColumnDSL<K extends org.simpleflatmapper.map.FieldKey<K>, MF extends org.simpleflatmapper.map.mapper.AbstractMapperFactory<K, MF, S>, S, T, KT> -
Field Summary
Fields inherited from class org.simpleflatmapper.map.mapper.AbstractMapperFactory
discriminators, getterFactory -
Method Summary
Modifier and TypeMethodDescriptionaddCustomValueReader(String key, CellValueReader<?> cellValueReader) addCustomValueReader(String key, org.simpleflatmapper.lightningcsv.StringReader<?> stringReader) cellValueReaderFactory(CellValueReaderFactory cellValueReaderFactory) defaultDateFormat(String defaultDateFormat) org.simpleflatmapper.map.mapper.AbstractColumnDefinitionProvider<CsvColumnKey>enrichColumnDefinitions(org.simpleflatmapper.map.mapper.AbstractColumnDefinitionProvider<CsvColumnKey> columnDefinitions) <T> CsvMapperBuilder<T>newBuilder(Class<T> target) Will create a newInstance of ResultSetMapperBuilder<T> CsvMapperBuilder<T>newBuilder(Type target) <T> CsvMapperBuilder<T>newBuilder(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta) <T> CsvMapperBuilder<T>newBuilder(org.simpleflatmapper.util.TypeReference<T> target) <T> CsvMapper<org.simpleflatmapper.map.Result<T,CsvColumnKey>> newErrorCollectingMapper(Class<T> target) <T> CsvMapper<org.simpleflatmapper.map.Result<T,CsvColumnKey>> newErrorCollectingMapper(Type target) <T> CsvMapper<org.simpleflatmapper.map.Result<T,CsvColumnKey>> newErrorCollectingMapper(org.simpleflatmapper.util.TypeReference<T> target) static CsvMapperFactoryinstantiate a new JdbcMapperFactorystatic CsvMapperFactorystatic CsvMapperFactorynewInstance(org.simpleflatmapper.map.mapper.AbstractColumnDefinitionProvider<CsvColumnKey> columnDefinitionProvider) <T> CsvMapper<T><T> CsvMapper<T><T> CsvMapper<T>newMapper(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta) <T> CsvMapper<T>newMapper(org.simpleflatmapper.util.TypeReference<T> target) Methods inherited from class org.simpleflatmapper.map.mapper.AbstractColumnNameDiscriminatorMapperFactory
discriminator, discriminator, discriminator, discriminatorMethods inherited from class org.simpleflatmapper.map.mapper.AbstractMapperFactory
addAlias, addAliases, addAliasForType, addColumnDefinition, addColumnDefinition, addColumnProperty, addColumnProperty, addColumnProperty, addColumnPropertyForType, addColumnPropertyForType, addColumnPropertyForType, addColumnPropertyForType, addGetterFactory, addGetterForType, addGetterForType, addGetterForType, addGetterForType, addGetterForType, addKeys, asmMapperNbFieldsLimit, assumeInjectionModifiesValues, columnDefinitions, columnDefinitions, consumerErrorHandler, consumerErrorHandler, discriminator, discriminator, discriminator, discriminator, discriminator, discriminator, discriminator, discriminator, enableSpeculativeArrayIndexResolution, enableSpeculativePropertyLookupOnObject, failOnAsm, fieldMapperErrorHandler, getClassMeta, getClassMeta, getClassMeta, getClassMetaWithExtraInstantiator, getClassMetaWithExtraInstantiator, getClassMetaWithExtraInstantiator, getReflectionService, ignoreColumns, ignoreColumns, ignoreColumns, ignorePropertyNotFound, mapperBuilderErrorHandler, mapperConfig, mapperConfig, maxMethodSize, propertyNameMatcherFactory, propertyNameMatcherFactory, reflectionService, rowFilter, rowHandlerErrorHandler, unorderedJoin, useAsm
-
Method Details
-
newInstance
instantiate a new JdbcMapperFactory- Returns:
- a new JdbcMapperFactory
-
newInstance
public static CsvMapperFactory newInstance(org.simpleflatmapper.map.mapper.AbstractColumnDefinitionProvider<CsvColumnKey> columnDefinitionProvider) -
newInstance
-
enrichColumnDefinitions
public org.simpleflatmapper.map.mapper.AbstractColumnDefinitionProvider<CsvColumnKey> enrichColumnDefinitions(org.simpleflatmapper.map.mapper.AbstractColumnDefinitionProvider<CsvColumnKey> columnDefinitions) - Overrides:
enrichColumnDefinitionsin classorg.simpleflatmapper.map.mapper.AbstractMapperFactory<CsvColumnKey,CsvMapperFactory, CsvRow>
-
defaultDateFormat
-
addCustomValueReader
-
addCustomValueReader
public CsvMapperFactory addCustomValueReader(String key, org.simpleflatmapper.lightningcsv.StringReader<?> stringReader) -
newMapper
public <T> CsvMapper<T> newMapper(Class<T> target) throws org.simpleflatmapper.map.MapperBuildingException - Type Parameters:
T- the targeted type- Parameters:
target- the targeted class for the jdbcMapper- Returns:
- a jdbc jdbcMapper that will map to the targeted class.
- Throws:
org.simpleflatmapper.map.MapperBuildingException- if an error occurs building the jdbcMapper
-
newMapper
public <T> CsvMapper<T> newMapper(org.simpleflatmapper.util.TypeReference<T> target) throws org.simpleflatmapper.map.MapperBuildingException - Throws:
org.simpleflatmapper.map.MapperBuildingException
-
newMapper
public <T> CsvMapper<T> newMapper(Type target) throws org.simpleflatmapper.map.MapperBuildingException - Throws:
org.simpleflatmapper.map.MapperBuildingException
-
newMapper
public <T> CsvMapper<T> newMapper(org.simpleflatmapper.reflect.meta.ClassMeta<T> classMeta) throws org.simpleflatmapper.map.MapperBuildingException - Throws:
org.simpleflatmapper.map.MapperBuildingException
-
newErrorCollectingMapper
public <T> CsvMapper<org.simpleflatmapper.map.Result<T,CsvColumnKey>> newErrorCollectingMapper(Class<T> target) throws org.simpleflatmapper.map.MapperBuildingException - Throws:
org.simpleflatmapper.map.MapperBuildingException
-
newErrorCollectingMapper
public <T> CsvMapper<org.simpleflatmapper.map.Result<T,CsvColumnKey>> newErrorCollectingMapper(org.simpleflatmapper.util.TypeReference<T> target) throws org.simpleflatmapper.map.MapperBuildingException - Throws:
org.simpleflatmapper.map.MapperBuildingException
-
newErrorCollectingMapper
public <T> CsvMapper<org.simpleflatmapper.map.Result<T,CsvColumnKey>> newErrorCollectingMapper(Type target) throws org.simpleflatmapper.map.MapperBuildingException - Throws:
org.simpleflatmapper.map.MapperBuildingException
-
newBuilder
Will create a newInstance of ResultSetMapperBuilder- Type Parameters:
T- the targeted type- Parameters:
target- the target class of the jdbcMapper- Returns:
- a builder ready to instantiate a jdbcMapper or to be customized
- Throws:
org.simpleflatmapper.map.MapperBuildingException- if an error occurs building the jdbcMapper
-
newBuilder
-
newBuilder
-
newBuilder
-
cellValueReaderFactory
-