public abstract class AbstractMapperFactory<K extends FieldKey<K>,CD extends ColumnDefinition<K,CD>,MF extends AbstractMapperFactory<K,CD,MF>> extends Object
| Constructor and Description |
|---|
AbstractMapperFactory(AbstractColumnDefinitionProvider<CD,K> columnDefinitions,
CD identity) |
AbstractMapperFactory(AbstractMapperFactory<K,CD,?> config) |
| Modifier and Type | Method and Description |
|---|---|
MF |
addAlias(String key,
String value)
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 |
addColumnDefinition(org.simpleflatmapper.util.Predicate<? super K> predicate,
CD columnDefinition)
Associate the specified columnDefinition to the property matching the predicate.
|
MF |
addColumnDefinition(String key,
CD 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 name,
Object... properties)
Associate the specified columnProperties to the property matching the predicate.
|
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.
|
ColumnDefinitionProvider<CD,K> |
columnDefinitions() |
ConsumerErrorHandler |
consumerErrorHandler() |
MF |
consumerErrorHandler(ConsumerErrorHandler consumerErrorHandler)
the ConsumerErrorHandler is called when an exception is thrown by the CheckedConsumer in the forEach call.
|
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 |
ignorePropertyNotFound()
Change the mapperBuilderErrorHandler to an IgnoreMapperBuilderErrorHandler.
|
MF |
mapperBuilderErrorHandler(MapperBuilderErrorHandler mapperBuilderErrorHandler)
Set the new MapperBuilderErrorHandler.
|
MapperConfig<K,CD> |
mapperConfig() |
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(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 |
rowHandlerErrorHandler(ConsumerErrorHandler rowHandlerErrorHandler)
Deprecated.
|
MF |
useAsm(boolean useAsm) |
public AbstractMapperFactory(AbstractMapperFactory<K,CD,?> config)
public AbstractMapperFactory(AbstractColumnDefinitionProvider<CD,K> columnDefinitions, CD identity)
public final MF fieldMapperErrorHandler(FieldMapperErrorHandler<K> fieldMapperErrorHandler)
fieldMapperErrorHandler - the new FieldMapperErrorHandlerpublic final MF ignorePropertyNotFound()
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,CD> mapperConfig()
public final MF addAlias(String key, String value)
key - the property to renamevalue - then name to rename topublic final MF addColumnDefinition(String key, CD columnDefinition)
key - the propertycolumnDefinition - the columnDefinitionpublic final MF addColumnDefinition(org.simpleflatmapper.util.Predicate<? super K> predicate, CD columnDefinition)
predicate - the property predicatecolumnDefinition - the columnDefinitionpublic final MF addColumnProperty(String name, Object... properties)
name - the property predicateproperties - 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 propertyNameMatcherFactory(PropertyNameMatcherFactory propertyNameMatcherFactory)
propertyNameMatcherFactory - the factorypublic final MF addAliases(Map<String,String> aliases)
aliases - the key value pairpublic final MF failOnAsm(boolean b)
b - true if we want the builder to fail on asm generation failurepublic 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<CD,K> columnDefinitions()
Copyright © 2017. All rights reserved.