public abstract class AbstractBeanDescriptorProvider extends Object implements BeanDescriptorProvider
BeanDescriptorProvider
applying the template pattern.
If you wonder how to implement the different abstract methods defined in this class have a look
at the BaseBeanDescriptorProvider.Modifier and Type | Class and Description |
---|---|
static class |
AbstractBeanDescriptorProvider.ContextualConverterFactory |
static class |
AbstractBeanDescriptorProvider.ContextualFactoryDecorator |
BeanDescriptorProvider.CompositeBeanDescriptorProvider
Modifier | Constructor and Description |
---|---|
protected |
AbstractBeanDescriptorProvider(AbstractBeanDescriptorProvider.ContextualConverterFactory contextualConverterFactory) |
Modifier and Type | Method and Description |
---|---|
protected abstract 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 abstract PropertyAccessor |
checkAndMergeAccessors(String name,
LinkedList<PropertyAccessor> accessors)
Implementations are supposed to merge the
PropertyAccessor s from accessors list into
a single PropertyAccessor. |
protected abstract PropertyMutator |
checkAndMergeMutators(String name,
LinkedList<PropertyMutator> mutators)
Implementations are supposed to merge the
PropertyMutator s from mutators list into a
single PropertyMutator. |
protected <T> BeanDescriptor<T> |
create(Class<T> forClass,
Type ofType,
BeanCreator creator,
List<PropertyAccessor> accessors,
Map<String,PropertyMutator> mutators,
Genson genson)
Creates an instance of BeanDescriptor based on the passed arguments.
|
protected abstract 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 abstract 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.
|
<T> BeanDescriptor<T> |
provide(Class<T> type,
Genson genson)
Provides a BeanDescriptor for "type" using current Genson instance.
|
<T> BeanDescriptor<T> |
provide(Class<T> ofClass,
Type ofType,
Genson genson)
Provides a BeanDescriptor that can serialize/deserialize "ofClass" type, based on "type"
argument.
|
protected abstract List<BeanCreator> |
provideBeanCreators(Type ofType,
Genson genson)
Provides a list of
BeanCreator for type ofType. |
protected abstract void |
provideBeanPropertyAccessors(Type ofType,
Map<String,LinkedList<PropertyAccessor>> accessorsMap,
Genson genson)
Adds resolved
PropertyAccessor to accessorsMap. |
protected abstract void |
provideBeanPropertyMutators(Type ofType,
Map<String,LinkedList<PropertyMutator>> mutatorsMap,
Genson genson)
Adds resolved
PropertyMutator to mutatorsMap. |
protected AbstractBeanDescriptorProvider(AbstractBeanDescriptorProvider.ContextualConverterFactory contextualConverterFactory)
public <T> BeanDescriptor<T> provide(Class<T> type, Genson genson)
BeanDescriptorProvider
provide
in interface BeanDescriptorProvider
type
- for which we need a BeanDescriptor.genson
- current instance.public <T> BeanDescriptor<T> provide(Class<T> ofClass, Type ofType, Genson genson)
BeanDescriptorProvider
provide
in interface BeanDescriptorProvider
ofClass
- is the Class for which we need a BeanDescriptor that will be able to
serialize/deserialize objects of that type;ofType
- to use to build this descriptor (use its declared methods, fields, etc).genson
- is the current Genson instance.protected <T> BeanDescriptor<T> create(Class<T> forClass, Type ofType, BeanCreator creator, List<PropertyAccessor> accessors, Map<String,PropertyMutator> mutators, Genson genson)
forClass
- ofType
- creator
- accessors
- mutators
- protected abstract List<BeanCreator> provideBeanCreators(Type ofType, Genson genson)
BeanCreator
for type ofType.ofType
- genson
- protected abstract void provideBeanPropertyMutators(Type ofType, Map<String,LinkedList<PropertyMutator>> mutatorsMap, Genson genson)
PropertyMutator
to mutatorsMap.ofType
- mutatorsMap
- genson
- protected abstract void provideBeanPropertyAccessors(Type ofType, Map<String,LinkedList<PropertyAccessor>> accessorsMap, Genson genson)
PropertyAccessor
to accessorsMap.ofType
- accessorsMap
- genson
- protected abstract BeanCreator checkAndMerge(Type ofType, List<BeanCreator> creators)
creators
- protected abstract PropertyMutator checkAndMergeMutators(String name, LinkedList<PropertyMutator> mutators)
PropertyMutator
s from mutators list into a
single PropertyMutator.name
- mutators
- protected abstract void mergeMutatorsWithCreatorProperties(Type ofType, Map<String,PropertyMutator> mutators, BeanCreator creator)
ofType
- mutators
- creator
- protected abstract void mergeAccessorsWithCreatorProperties(Type ofType, List<PropertyAccessor> accessors, BeanCreator creator)
ofType
- accessors
- creator
- protected abstract PropertyAccessor checkAndMergeAccessors(String name, LinkedList<PropertyAccessor> accessors)
PropertyAccessor
s from accessors list into
a single PropertyAccessor.name
- accessors
- Copyright © 2019. All rights reserved.