public class BaseBeanDescriptorProvider extends AbstractBeanDescriptorProvider
BeanMutatorAccessorResolver
and PropertyNameResolver
. If you want to change the
way BeanDescriptors are created you can subclass this class and override the needed methods. If
you only want to create instances of your own PropertyMutators/PropertyAccessors or BeanCreators
just override the corresponding createXXX methods.AbstractBeanDescriptorProvider.ContextualConverterFactory, AbstractBeanDescriptorProvider.ContextualFactoryDecorator
BeanDescriptorProvider.CompositeBeanDescriptorProvider
Modifier and Type | Field and Description |
---|---|
protected boolean |
favorEmptyCreators |
protected BeanMutatorAccessorResolver |
mutatorAccessorResolver |
protected PropertyNameResolver |
nameResolver |
protected boolean |
useFields |
protected boolean |
useGettersAndSetters |
Constructor and Description |
---|
BaseBeanDescriptorProvider(AbstractBeanDescriptorProvider.ContextualConverterFactory ctxConverterFactory,
BeanPropertyFactory propertyFactory,
BeanMutatorAccessorResolver mutatorAccessorResolver,
PropertyNameResolver nameResolver,
boolean useGettersAndSetters,
boolean useFields,
boolean favorEmptyCreators) |
Modifier and Type | Method and Description |
---|---|
protected <T extends BeanProperty> |
_mostSpecificPropertyDeclaringClass(String name,
LinkedList<T> properties) |
protected void |
_throwCouldCreateBeanDescriptor(Class<?> ofClass,
String reason) |
protected BeanCreator |
checkAndMerge(Type ofType,
List<BeanCreator> creators)
Implementations of this method can do some additional checks on the creators validity or do
any other operations related to creators.
|
protected PropertyAccessor |
checkAndMergeAccessors(String name,
LinkedList<PropertyAccessor> accessors)
Implementations are supposed to merge the
PropertyAccessor s from accessors list into
a single PropertyAccessor. |
protected PropertyMutator |
checkAndMergeMutators(String name,
LinkedList<PropertyMutator> mutators)
Implementations are supposed to merge the
PropertyMutator s from mutators list into a
single PropertyMutator. |
protected void |
mergeAccessorsWithCreatorProperties(Type ofType,
List<PropertyAccessor> accessors,
BeanCreator creator)
Implementations may do additional merge operations based on the resolved creator
parameters and the resolved accessors.
|
protected void |
mergeMutatorsWithCreatorProperties(Type ofType,
Map<String,PropertyMutator> mutators,
BeanCreator creator)
Implementations may do additional merge operations based on the resolved creator
parameters and the resolved mutators.
|
List<BeanCreator> |
provideBeanCreators(Type ofType,
Genson genson)
Provides a list of
BeanCreator for type ofType. |
void |
provideBeanPropertyAccessors(Type ofType,
Map<String,LinkedList<PropertyAccessor>> accessorsMap,
Genson genson)
Adds resolved
PropertyAccessor to accessorsMap. |
void |
provideBeanPropertyMutators(Type ofType,
Map<String,LinkedList<PropertyMutator>> mutatorsMap,
Genson genson)
Adds resolved
PropertyMutator to mutatorsMap. |
protected void |
provideConstructorCreators(Type ofType,
List<BeanCreator> creators,
Genson genson) |
protected void |
provideFieldAccessors(Class<?> ofClass,
Map<String,LinkedList<PropertyAccessor>> accessorsMap,
Type ofType,
Genson genson) |
protected void |
provideFieldMutators(Class<?> ofClass,
Map<String,LinkedList<PropertyMutator>> mutatorsMap,
Type ofType,
Genson genson) |
protected void |
provideMethodAccessors(Class<?> ofClass,
Map<String,LinkedList<PropertyAccessor>> accessorsMap,
Type ofType,
Genson genson) |
protected void |
provideMethodCreators(Class<?> ofClass,
List<BeanCreator> creators,
Type ofType,
Genson genson) |
protected void |
provideMethodMutators(Class<?> ofClass,
Map<String,LinkedList<PropertyMutator>> mutatorsMap,
Type ofType,
Genson genson) |
protected <T extends BeanProperty> |
update(T property,
Map<String,LinkedList<T>> map) |
create, provide, provide
protected final BeanMutatorAccessorResolver mutatorAccessorResolver
protected final PropertyNameResolver nameResolver
protected final boolean useGettersAndSetters
protected final boolean useFields
protected final boolean favorEmptyCreators
public BaseBeanDescriptorProvider(AbstractBeanDescriptorProvider.ContextualConverterFactory ctxConverterFactory, BeanPropertyFactory propertyFactory, BeanMutatorAccessorResolver mutatorAccessorResolver, PropertyNameResolver nameResolver, boolean useGettersAndSetters, boolean useFields, boolean favorEmptyCreators)
public List<BeanCreator> provideBeanCreators(Type ofType, Genson genson)
AbstractBeanDescriptorProvider
BeanCreator
for type ofType.provideBeanCreators
in class AbstractBeanDescriptorProvider
public void provideBeanPropertyAccessors(Type ofType, Map<String,LinkedList<PropertyAccessor>> accessorsMap, Genson genson)
AbstractBeanDescriptorProvider
PropertyAccessor
to accessorsMap.provideBeanPropertyAccessors
in class AbstractBeanDescriptorProvider
public void provideBeanPropertyMutators(Type ofType, Map<String,LinkedList<PropertyMutator>> mutatorsMap, Genson genson)
AbstractBeanDescriptorProvider
PropertyMutator
to mutatorsMap.provideBeanPropertyMutators
in class AbstractBeanDescriptorProvider
protected void provideConstructorCreators(Type ofType, List<BeanCreator> creators, Genson genson)
protected void provideMethodCreators(Class<?> ofClass, List<BeanCreator> creators, Type ofType, Genson genson)
protected void provideFieldAccessors(Class<?> ofClass, Map<String,LinkedList<PropertyAccessor>> accessorsMap, Type ofType, Genson genson)
protected void provideMethodAccessors(Class<?> ofClass, Map<String,LinkedList<PropertyAccessor>> accessorsMap, Type ofType, Genson genson)
protected void provideFieldMutators(Class<?> ofClass, Map<String,LinkedList<PropertyMutator>> mutatorsMap, Type ofType, Genson genson)
protected void provideMethodMutators(Class<?> ofClass, Map<String,LinkedList<PropertyMutator>> mutatorsMap, Type ofType, Genson genson)
protected <T extends BeanProperty> void update(T property, Map<String,LinkedList<T>> map)
protected BeanCreator checkAndMerge(Type ofType, List<BeanCreator> creators)
AbstractBeanDescriptorProvider
checkAndMerge
in class AbstractBeanDescriptorProvider
protected void _throwCouldCreateBeanDescriptor(Class<?> ofClass, String reason)
protected PropertyAccessor checkAndMergeAccessors(String name, LinkedList<PropertyAccessor> accessors)
AbstractBeanDescriptorProvider
PropertyAccessor
s from accessors list into
a single PropertyAccessor.checkAndMergeAccessors
in class AbstractBeanDescriptorProvider
protected PropertyMutator checkAndMergeMutators(String name, LinkedList<PropertyMutator> mutators)
AbstractBeanDescriptorProvider
PropertyMutator
s from mutators list into a
single PropertyMutator.checkAndMergeMutators
in class AbstractBeanDescriptorProvider
protected <T extends BeanProperty> T _mostSpecificPropertyDeclaringClass(String name, LinkedList<T> properties)
protected void mergeMutatorsWithCreatorProperties(Type ofType, Map<String,PropertyMutator> mutators, BeanCreator creator)
AbstractBeanDescriptorProvider
mergeMutatorsWithCreatorProperties
in class AbstractBeanDescriptorProvider
protected void mergeAccessorsWithCreatorProperties(Type ofType, List<PropertyAccessor> accessors, BeanCreator creator)
AbstractBeanDescriptorProvider
mergeAccessorsWithCreatorProperties
in class AbstractBeanDescriptorProvider
Copyright © 2019. All rights reserved.