public abstract class AbstractMapperFactory<K extends FieldKey<K>,MF extends AbstractMapperFactory<K,MF,S>,S> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractMapperFactory.DiscriminatorBuilder<S,K extends FieldKey<K>,T> |
static class |
AbstractMapperFactory.DiscriminatorConditionBuilder<S,K extends FieldKey<K>,KT,T> |
static class |
AbstractMapperFactory.DiscriminatorDSL<K extends FieldKey<K>,MF extends AbstractMapperFactory<K,MF,S>,S,T> |
static class |
AbstractMapperFactory.DiscriminatorOnColumnDSL<K extends FieldKey<K>,MF extends AbstractMapperFactory<K,MF,S>,S,T,KT> |
| Modifier and Type | Field and Description |
|---|---|
protected List<MapperConfig.Discriminator<S,K,?>> |
discriminators |
protected ContextualGetterFactory<? super S,K> |
getterFactory |
| Constructor and Description |
|---|
AbstractMapperFactory(AbstractColumnDefinitionProvider<K> columnDefinitions,
ColumnDefinition<K,?> identity,
ContextualGetterFactory<? super S,K> getterFactory) |
AbstractMapperFactory(AbstractColumnDefinitionProvider<K> columnDefinitions,
ColumnDefinition<K,?> identity,
org.simpleflatmapper.util.Function<MF,? extends ContextualGetterFactory<? super S,K>> getterFactoryFactory) |
AbstractMapperFactory(AbstractMapperFactory<K,?,S> config) |
| Modifier and Type | Method and Description |
|---|---|
MF |
addAlias(String column,
String actualPropertyName)
Associate an alias on the property key to rename to value.
|
MF |
addAliases(Map<String,String> aliases)
Associate the aliases value to the property key.
|
MF |
addAliasForType(Type type,
String column,
String actualPropertyName)
Associate an alias on the property key to rename to value on the specific type.
|
MF |
addColumnDefinition(org.simpleflatmapper.util.Predicate<? super K> predicate,
ColumnDefinition<K,?> columnDefinition)
Associate the specified columnDefinition to the property matching the predicate.
|
MF |
addColumnDefinition(String column,
ColumnDefinition<K,?> columnDefinition)
Associate the specified columnDefinition to the specified property.
|
MF |
addColumnProperty(org.simpleflatmapper.util.Predicate<? super K> predicate,
Object... properties)
Associate the specified columnProperties to the property matching the predicate.
|
MF |
addColumnProperty(org.simpleflatmapper.util.Predicate<? super K> predicate,
org.simpleflatmapper.util.UnaryFactory<K,Object> propertyFactory)
Associate the specified columnProperties to the property matching the predicate.
|
MF |
addColumnProperty(String column,
Object... properties)
Associate the specified columnProperties to the property matching the predicate.
|
MF |
addColumnPropertyForType(org.simpleflatmapper.util.Predicate<Type> typePredicate,
org.simpleflatmapper.util.Predicate<? super K> keyPredicate,
org.simpleflatmapper.util.UnaryFactory<K,Object> propertyFactory)
Associate the specified columnProperties to the property matching the key predicate and type predicate.
|
MF |
addColumnPropertyForType(Type type,
org.simpleflatmapper.util.Predicate<? super K> keyPredicate,
Object... properties)
Associate the specified columnProperties to the property matching the key predicate and type.
|
MF |
addColumnPropertyForType(Type type,
org.simpleflatmapper.util.Predicate<? super K> keyPredicate,
org.simpleflatmapper.util.UnaryFactory<K,Object> propertyFactory)
Associate the specified columnProperties to the property matching the key predicate and type.
|
MF |
addColumnPropertyForType(Type type,
String column,
Object... properties)
Associate the specified columnProperties to the property matching the key predicate and type.
|
MF |
addGetterFactory(ContextualGetterFactory<S,K> getterFactory) |
MF |
addGetterForType(org.simpleflatmapper.util.Predicate<Type> typePredicate,
ContextualGetterFactory<S,K> getterFactory) |
MF |
addGetterForType(org.simpleflatmapper.util.Predicate<Type> typePredicate,
org.simpleflatmapper.util.Function<K,ContextualGetter<S,?>> getterFactory) |
MF |
addGetterForType(Type type,
ContextualGetterFactory<S,K> getterFactory) |
MF |
addGetterForType(Type type,
org.simpleflatmapper.util.Function<K,ContextualGetter<S,?>> getterFactory) |
<T> MF |
addGetterForType(Type type,
org.simpleflatmapper.reflect.IndexedGetter<S,T> indexedGetter) |
MF |
addKeys(String... columns)
Mark the specified columns as keys.
|
MF |
asmMapperNbFieldsLimit(int asmMapperNbFieldsLimit)
change the number of fields threshold after which an asm jdbcMapper is not generated.
|
MF |
assumeInjectionModifiesValues(boolean b)
if set to true, it will assume any constructor that takes a list as a constructor argument will need
to be mapped using a builder to protect against the actual value being changed in the constructor.
|
ColumnDefinitionProvider<K> |
columnDefinitions() |
AbstractColumnDefinitionProvider<K> |
columnDefinitions(Type targetType) |
ConsumerErrorHandler |
consumerErrorHandler() |
MF |
consumerErrorHandler(ConsumerErrorHandler consumerErrorHandler)
the ConsumerErrorHandler is called when an exception is thrown by the CheckedConsumer in the forEach call.
|
<T> AbstractMapperFactory.DiscriminatorDSL<K,MF,S,T> |
discriminator(Class<T> commonType) |
<T> MF |
discriminator(Class<T> commonType,
org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorBuilder<S,K,T>> consumer)
Deprecated.
use
discriminator(Type) dsl |
<T,V> MF |
discriminator(Class<T> commonType,
org.simpleflatmapper.reflect.Getter<? super S,V> getter,
org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,V,T>> consumer)
Deprecated.
use
discriminator(Type) dsl |
<T,V> MF |
discriminator(Class<T> commonType,
String discriminatorColumn,
org.simpleflatmapper.util.CheckedBiFunction<S,String,V> discriminatorFieldAccessor,
org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,V,T>> consumer)
Deprecated.
use
discriminator(Type) dsl |
<T> AbstractMapperFactory.DiscriminatorDSL<K,MF,S,T> |
discriminator(Type commonType) |
<T> MF |
discriminator(Type commonType,
org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorBuilder<S,K,T>> consumer)
Deprecated.
use
discriminator(Type) dsl |
<T,KT> MF |
discriminator(Type commonType,
org.simpleflatmapper.reflect.Getter<? super S,KT> getter,
org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,KT,T>> consumer)
Deprecated.
use
discriminator(Type) dsl |
<T,V> MF |
discriminator(Type commonType,
String discriminatorColumn,
org.simpleflatmapper.util.CheckedBiFunction<S,String,V> discriminatorFieldAccessor,
org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,V,T>> consumer)
Deprecated.
use
discriminator(Type) dsl |
MF |
enableSpeculativeArrayIndexResolution() |
MF |
enableSpeculativePropertyLookupOnObject()
enabled speculative property look up on object.
|
AbstractColumnDefinitionProvider<K> |
enrichColumnDefinitions(AbstractColumnDefinitionProvider<K> columnDefinitions) |
MF |
failOnAsm(boolean b) |
MF |
fieldMapperErrorHandler(FieldMapperErrorHandler<K> fieldMapperErrorHandler)
the FieldMapperErrorHandler is called when a error occurred when mapping a field from the source to the target.
|
<T> org.simpleflatmapper.reflect.meta.ClassMeta<T> |
getClassMeta(Class<T> target) |
<T> org.simpleflatmapper.reflect.meta.ClassMeta<T> |
getClassMeta(Type target) |
<T> org.simpleflatmapper.reflect.meta.ClassMeta<T> |
getClassMeta(org.simpleflatmapper.util.TypeReference<T> target) |
<T> org.simpleflatmapper.reflect.meta.ClassMeta<T> |
getClassMetaWithExtraInstantiator(Class<T> target,
Member instantiator) |
<T> org.simpleflatmapper.reflect.meta.ClassMeta<T> |
getClassMetaWithExtraInstantiator(Type target,
Member instantiator) |
<T> org.simpleflatmapper.reflect.meta.ClassMeta<T> |
getClassMetaWithExtraInstantiator(org.simpleflatmapper.util.TypeReference<T> target,
Member instantiator) |
org.simpleflatmapper.reflect.ReflectionService |
getReflectionService() |
MF |
ignoreColumns(Collection<String> columnNames)
Ignore column with the specified names, case insensitive.
|
MF |
ignoreColumns(org.simpleflatmapper.util.Predicate<? super K> predicate)
Ignore column that match the predicate.
|
MF |
ignoreColumns(String... columnNames)
Ignore column with the specified names, case insensitive.
|
MF |
ignorePropertyNotFound()
Change the mapperBuilderErrorHandler to an IgnoreMapperBuilderErrorHandler.
|
MF |
mapperBuilderErrorHandler(MapperBuilderErrorHandler mapperBuilderErrorHandler)
Set the new MapperBuilderErrorHandler.
|
MapperConfig<K,S> |
mapperConfig() |
MapperConfig<K,S> |
mapperConfig(Type targetType) |
MF |
maxMethodSize(int maxMethodSize)
Number needs to be a power of 2, do not use if you don't know what it does.
|
MF |
propertyNameMatcherFactory(org.simpleflatmapper.util.Function<PropertyNameMatcherFactory,PropertyNameMatcherFactory> propertyNameMatcherFactorySetup)
Override the default PropertyNameMatcherFactory with the specified factory.
|
MF |
propertyNameMatcherFactory(PropertyNameMatcherFactory propertyNameMatcherFactory)
Override the default PropertyNameMatcherFactory with the specified factory.
|
MF |
reflectionService(org.simpleflatmapper.reflect.ReflectionService reflectionService)
Override the default implementation of the ReflectionService.
|
MF |
rowFilter(org.simpleflatmapper.util.Predicate<? super S> rowFilter) |
MF |
rowHandlerErrorHandler(ConsumerErrorHandler rowHandlerErrorHandler)
Deprecated.
|
MF |
unorderedJoin()
Enabled support for unordered join at the root level.
|
MF |
useAsm(boolean useAsm) |
protected final List<MapperConfig.Discriminator<S,K extends FieldKey<K>,?>> discriminators
protected ContextualGetterFactory<? super S,K extends FieldKey<K>> getterFactory
public AbstractMapperFactory(AbstractMapperFactory<K,?,S> config)
public AbstractMapperFactory(AbstractColumnDefinitionProvider<K> columnDefinitions, ColumnDefinition<K,?> identity, ContextualGetterFactory<? super S,K> getterFactory)
public AbstractMapperFactory(AbstractColumnDefinitionProvider<K> columnDefinitions, ColumnDefinition<K,?> identity, org.simpleflatmapper.util.Function<MF,? extends ContextualGetterFactory<? super S,K>> getterFactoryFactory)
public final MF fieldMapperErrorHandler(FieldMapperErrorHandler<K> fieldMapperErrorHandler)
fieldMapperErrorHandler - the new FieldMapperErrorHandlerpublic final MF unorderedJoin()
public final MF ignorePropertyNotFound()
public final MF enableSpeculativePropertyLookupOnObject()
public final MF mapperBuilderErrorHandler(MapperBuilderErrorHandler mapperBuilderErrorHandler)
mapperBuilderErrorHandler - the MapperBuilderErrorHandlerpublic final MF consumerErrorHandler(ConsumerErrorHandler consumerErrorHandler)
consumerErrorHandler - the new ConsumerErrorHandler@Deprecated public final MF rowHandlerErrorHandler(ConsumerErrorHandler rowHandlerErrorHandler)
public final MF useAsm(boolean useAsm)
useAsm - false if you want to disable asm generation of Mappers, Getter and Setter. This would be active by default if asm is present in a compatible version.public final MF reflectionService(org.simpleflatmapper.reflect.ReflectionService reflectionService)
reflectionService - the overriding newInstancepublic final MapperConfig<K,S> mapperConfig()
public final MapperConfig<K,S> mapperConfig(Type targetType)
public AbstractColumnDefinitionProvider<K> enrichColumnDefinitions(AbstractColumnDefinitionProvider<K> columnDefinitions)
public final MF addAlias(String column, String actualPropertyName)
column - the column name to renameactualPropertyName - then name to rename to match the actual property namepublic final MF addAliasForType(Type type, String column, String actualPropertyName)
column - the column name to renameactualPropertyName - then name to rename to match the actual property namepublic final MF addColumnDefinition(String column, ColumnDefinition<K,?> columnDefinition)
column - the name of the columncolumnDefinition - the columnDefinitionpublic final MF addColumnDefinition(org.simpleflatmapper.util.Predicate<? super K> predicate, ColumnDefinition<K,?> columnDefinition)
predicate - the property predicatecolumnDefinition - the columnDefinitionpublic final MF addColumnProperty(String column, Object... properties)
column - the column nameproperties - the propertiespublic final MF addColumnProperty(org.simpleflatmapper.util.Predicate<? super K> predicate, Object... properties)
predicate - the property predicateproperties - the propertiespublic final MF addColumnProperty(org.simpleflatmapper.util.Predicate<? super K> predicate, org.simpleflatmapper.util.UnaryFactory<K,Object> propertyFactory)
predicate - the property predicatepropertyFactory - the propertiespublic final MF addColumnPropertyForType(Type type, String column, Object... properties)
type - the typecolumn - the property predicateproperties - the propertiespublic final MF addColumnPropertyForType(Type type, org.simpleflatmapper.util.Predicate<? super K> keyPredicate, Object... properties)
type - the typekeyPredicate - the property predicateproperties - the propertiespublic final MF addColumnPropertyForType(Type type, org.simpleflatmapper.util.Predicate<? super K> keyPredicate, org.simpleflatmapper.util.UnaryFactory<K,Object> propertyFactory)
type - the typekeyPredicate - the property predicatepropertyFactory - the propertiespublic final MF addColumnPropertyForType(org.simpleflatmapper.util.Predicate<Type> typePredicate, org.simpleflatmapper.util.Predicate<? super K> keyPredicate, org.simpleflatmapper.util.UnaryFactory<K,Object> propertyFactory)
typePredicate - the type predicatekeyPredicate - the property predicatepropertyFactory - the propertiespublic final MF propertyNameMatcherFactory(PropertyNameMatcherFactory propertyNameMatcherFactory)
propertyNameMatcherFactory - the factorypublic final MF propertyNameMatcherFactory(org.simpleflatmapper.util.Function<PropertyNameMatcherFactory,PropertyNameMatcherFactory> propertyNameMatcherFactorySetup)
propertyNameMatcherFactorySetup - a function that takes the current factory and return the newly configured onepublic final MF addAliases(Map<String,String> aliases)
aliases - the key value pairpublic final MF ignoreColumns(org.simpleflatmapper.util.Predicate<? super K> predicate)
predicate - the predicate.public final MF ignoreColumns(String... columnNames)
columnNames - the columnNames.public MF addGetterFactory(ContextualGetterFactory<S,K> getterFactory)
public MF addGetterForType(Type type, org.simpleflatmapper.util.Function<K,ContextualGetter<S,?>> getterFactory)
public MF addGetterForType(Type type, ContextualGetterFactory<S,K> getterFactory)
public <T> MF addGetterForType(Type type, org.simpleflatmapper.reflect.IndexedGetter<S,T> indexedGetter)
public MF addGetterForType(org.simpleflatmapper.util.Predicate<Type> typePredicate, org.simpleflatmapper.util.Function<K,ContextualGetter<S,?>> getterFactory)
public MF addGetterForType(org.simpleflatmapper.util.Predicate<Type> typePredicate, ContextualGetterFactory<S,K> getterFactory)
public final MF ignoreColumns(Collection<String> columnNames)
columnNames - the columnNames.public final MF failOnAsm(boolean b)
b - true if we want the builder to fail on asm generation failurepublic final MF assumeInjectionModifiesValues(boolean b)
b - true to make the factory being paranoid about constructor injection of aggregationpublic final MF asmMapperNbFieldsLimit(int asmMapperNbFieldsLimit)
the default value is calculated from the benchmark results, currently 240.
asmMapperNbFieldsLimit - the limit after which it does not use asm for the jdbcMapper.public final MF maxMethodSize(int maxMethodSize)
maxMethodSize - the max method size, needs be a power of 2.public final MF addKeys(String... columns)
columns - the columnspublic final ConsumerErrorHandler consumerErrorHandler()
public final <T> org.simpleflatmapper.reflect.meta.ClassMeta<T> getClassMeta(org.simpleflatmapper.util.TypeReference<T> target)
public final <T> org.simpleflatmapper.reflect.meta.ClassMeta<T> getClassMeta(Class<T> target)
public final <T> org.simpleflatmapper.reflect.meta.ClassMeta<T> getClassMeta(Type target)
public final <T> org.simpleflatmapper.reflect.meta.ClassMeta<T> getClassMetaWithExtraInstantiator(org.simpleflatmapper.util.TypeReference<T> target,
Member instantiator)
public final <T> org.simpleflatmapper.reflect.meta.ClassMeta<T> getClassMetaWithExtraInstantiator(Class<T> target, Member instantiator)
public final <T> org.simpleflatmapper.reflect.meta.ClassMeta<T> getClassMetaWithExtraInstantiator(Type target, Member instantiator)
public org.simpleflatmapper.reflect.ReflectionService getReflectionService()
public ColumnDefinitionProvider<K> columnDefinitions()
public AbstractColumnDefinitionProvider<K> columnDefinitions(Type targetType)
public <T> AbstractMapperFactory.DiscriminatorDSL<K,MF,S,T> discriminator(Class<T> commonType)
public <T> AbstractMapperFactory.DiscriminatorDSL<K,MF,S,T> discriminator(Type commonType)
@Deprecated public <T> MF discriminator(Type commonType, org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorBuilder<S,K,T>> consumer)
discriminator(Type) dsl@Deprecated public <T,KT> MF discriminator(Type commonType, org.simpleflatmapper.reflect.Getter<? super S,KT> getter, org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,KT,T>> consumer)
discriminator(Type) dsl@Deprecated public <T> MF discriminator(Class<T> commonType, org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorBuilder<S,K,T>> consumer)
discriminator(Type) dsl@Deprecated public <T,V> MF discriminator(Class<T> commonType, org.simpleflatmapper.reflect.Getter<? super S,V> getter, org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,V,T>> consumer)
discriminator(Type) dsl@Deprecated public <T,V> MF discriminator(Class<T> commonType, String discriminatorColumn, org.simpleflatmapper.util.CheckedBiFunction<S,String,V> discriminatorFieldAccessor, org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,V,T>> consumer)
discriminator(Type) dsl@Deprecated public <T,V> MF discriminator(Type commonType, String discriminatorColumn, org.simpleflatmapper.util.CheckedBiFunction<S,String,V> discriminatorFieldAccessor, org.simpleflatmapper.util.Consumer<AbstractMapperFactory.DiscriminatorConditionBuilder<S,K,V,T>> consumer)
discriminator(Type) dslpublic MF enableSpeculativeArrayIndexResolution()
Copyright © 2020. All rights reserved.