public class BasicBeanDescription extends BeanDescription
BeanDescription implementation.
Can theoretically be subclassed to customize
some aspects of property introspection.| 限定符和类型 | 字段和说明 |
|---|---|
protected AnnotationIntrospector |
_annotationIntrospector |
protected AnnotatedMethod |
_anyGetterMethod |
protected AnnotatedMethod |
_anySetterMethod |
protected TypeBindings |
_bindings
We may need type bindings for the bean type.
|
protected AnnotatedClass |
_classInfo
Information collected about the class introspected.
|
protected MapperConfig<?> |
_config |
protected Set<String> |
_ignoredPropertyNames
Set of properties that can be ignored during deserialization, due
to being marked as ignored.
|
protected Set<String> |
_ignoredPropertyNamesForDeser |
protected Map<Object,AnnotatedMember> |
_injectables |
protected AnnotatedMethod |
_jsonValueMethod |
protected List<BeanPropertyDefinition> |
_properties
Properties collected for the POJO.
|
_type| 限定符 | 构造器和说明 |
|---|---|
|
BasicBeanDescription(MapperConfig<?> config,
JavaType type,
AnnotatedClass ac)
已过时。
Since 1.9, should use factory methods instead
|
protected |
BasicBeanDescription(MapperConfig<?> config,
JavaType type,
AnnotatedClass ac,
List<BeanPropertyDefinition> properties) |
| 限定符和类型 | 方法和说明 |
|---|---|
LinkedHashMap<String,AnnotatedField> |
_findPropertyFields(Collection<String> ignoredProperties,
boolean forSerialization) |
TypeBindings |
bindingsForBeanType()
Accessor for type bindings that may be needed to fully resolve
types of member object, such as return and argument types of
methods and constructors, and types of fields.
|
AnnotatedMethod |
findAnyGetter()
Method used to locate the method of introspected class that
implements
JsonAnyGetter. |
AnnotatedMethod |
findAnySetter()
Method used to locate the method of introspected class that
implements
JsonAnySetter. |
Map<String,AnnotatedMember> |
findBackReferenceProperties()
Method for locating all back-reference properties (setters, fields) bean has
|
List<String> |
findCreatorPropertyNames()
Method for getting ordered list of named Creator properties.
|
AnnotatedConstructor |
findDefaultConstructor()
Method that will locate the no-arg constructor for this class,
if it has one, and that constructor has not been marked as
ignorable.
|
LinkedHashMap<String,AnnotatedField> |
findDeserializableFields(VisibilityChecker<?> visibilityChecker,
Collection<String> ignoredProperties) |
Method |
findFactoryMethod(Class<?>... expArgTypes)
Method that can be called to find if introspected class declares
a static "valueOf" factory method that returns an instance of
introspected type, given one of acceptable types.
|
LinkedHashMap<String,AnnotatedMethod> |
findGetters(VisibilityChecker<?> visibilityChecker,
Collection<String> ignoredProperties) |
Map<Object,AnnotatedMember> |
findInjectables() |
AnnotatedMethod |
findJsonValueMethod()
Method for locating the getter method that is annotated with
JsonValue annotation,
if any. |
AnnotatedMethod |
findMethod(String name,
Class<?>[] paramTypes) |
List<BeanPropertyDefinition> |
findProperties() |
LinkedHashMap<String,AnnotatedField> |
findSerializableFields(VisibilityChecker<?> visibilityChecker,
Collection<String> ignoredProperties) |
JsonSerialize.Inclusion |
findSerializationInclusion(JsonSerialize.Inclusion defValue)
Method for determining whether null properties should be written
out for a Bean of introspected type.
|
LinkedHashMap<String,AnnotatedMethod> |
findSetters(VisibilityChecker<?> visibilityChecker) |
Constructor<?> |
findSingleArgConstructor(Class<?>... argTypes)
Method that can be called to locate a single-arg constructor that
takes specified exact type (will not accept supertype constructors)
|
static BasicBeanDescription |
forDeserialization(POJOPropertiesCollector coll)
Factory method to use for constructing an instance to use for building
deserializers.
|
static BasicBeanDescription |
forOtherUse(MapperConfig<?> config,
JavaType type,
AnnotatedClass ac)
Factory method to use for constructing an instance to use for purposes
other than building serializers or deserializers; will only have information
on class, not on properties.
|
static BasicBeanDescription |
forSerialization(POJOPropertiesCollector coll)
Factory method to use for constructing an instance to use for building
serializers.
|
Annotations |
getClassAnnotations()
Method for accessing collection of annotations the bean
class has.
|
AnnotatedClass |
getClassInfo() |
List<AnnotatedConstructor> |
getConstructors() |
List<AnnotatedMethod> |
getFactoryMethods() |
Set<String> |
getIgnoredPropertyNames() |
Set<String> |
getIgnoredPropertyNamesForDeser() |
boolean |
hasKnownClassAnnotations()
Method for checking whether class being described has any
annotations recognized by registered annotation introspector.
|
Object |
instantiateBean(boolean fixAccess)
Method called to create a "default instance" of the bean, currently
only needed for obtaining default field values which may be used for
suppressing serialization of fields that have "not changed".
|
protected boolean |
isFactoryMethod(AnnotatedMethod am) |
JavaType |
resolveType(Type jdkType)
Method for resolving given JDK type, using this bean as the
generic type resolution context.
|
getBeanClass, getTypeprotected final MapperConfig<?> _config
protected final AnnotationIntrospector _annotationIntrospector
protected final AnnotatedClass _classInfo
protected TypeBindings _bindings
protected final List<BeanPropertyDefinition> _properties
protected AnnotatedMethod _anySetterMethod
protected Map<Object,AnnotatedMember> _injectables
protected Set<String> _ignoredPropertyNames
protected AnnotatedMethod _jsonValueMethod
protected AnnotatedMethod _anyGetterMethod
@Deprecated public BasicBeanDescription(MapperConfig<?> config, JavaType type, AnnotatedClass ac)
protected BasicBeanDescription(MapperConfig<?> config, JavaType type, AnnotatedClass ac, List<BeanPropertyDefinition> properties)
public static BasicBeanDescription forDeserialization(POJOPropertiesCollector coll)
public static BasicBeanDescription forSerialization(POJOPropertiesCollector coll)
public static BasicBeanDescription forOtherUse(MapperConfig<?> config, JavaType type, AnnotatedClass ac)
public AnnotatedClass getClassInfo()
getClassInfo 在类中 BeanDescriptionpublic List<BeanPropertyDefinition> findProperties()
findProperties 在类中 BeanDescriptionpublic AnnotatedMethod findJsonValueMethod()
JsonValue annotation,
if any. If multiple ones are found,
an error is reported by throwing IllegalArgumentExceptionfindJsonValueMethod 在类中 BeanDescriptionpublic Set<String> getIgnoredPropertyNames()
getIgnoredPropertyNames 在类中 BeanDescriptionpublic boolean hasKnownClassAnnotations()
hasKnownClassAnnotations 在类中 BeanDescriptionpublic Annotations getClassAnnotations()
BeanDescriptiongetClassAnnotations 在类中 BeanDescriptionpublic TypeBindings bindingsForBeanType()
BeanDescriptionbindingsForBeanType 在类中 BeanDescriptionpublic JavaType resolveType(Type jdkType)
BeanDescriptionresolveType 在类中 BeanDescriptionpublic AnnotatedConstructor findDefaultConstructor()
findDefaultConstructor 在类中 BeanDescriptionpublic AnnotatedMethod findAnySetter() throws IllegalArgumentException
JsonAnySetter. If no such method exists
null is returned. If more than one are found, an exception
is thrown.
Additional checks are also made to see that method signature
is acceptable: needs to take 2 arguments, first one String or
Object; second any can be any type.findAnySetter 在类中 BeanDescriptionIllegalArgumentExceptionpublic Map<Object,AnnotatedMember> findInjectables()
findInjectables 在类中 BeanDescriptionpublic List<AnnotatedConstructor> getConstructors()
public AnnotatedMethod findMethod(String name, Class<?>[] paramTypes)
public Object instantiateBean(boolean fixAccess)
fixAccess - If true, method is allowed to fix access to the
default constructor (to be able to call non-public constructor);
if false, has to use constructor as is.public List<AnnotatedMethod> getFactoryMethods()
public Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
argTypes - Type(s) of the argument that we are looking forpublic Method findFactoryMethod(Class<?>... expArgTypes)
expArgTypes - Types that the matching single argument factory
method can take: will also accept super types of these types
(ie. arg just has to be assignable from expArgType)protected boolean isFactoryMethod(AnnotatedMethod am)
public List<String> findCreatorPropertyNames()
public JsonSerialize.Inclusion findSerializationInclusion(JsonSerialize.Inclusion defValue)
public AnnotatedMethod findAnyGetter() throws IllegalArgumentException
JsonAnyGetter.
If no such method exists null is returned.
If more than one are found, an exception is thrown.findAnyGetter 在类中 BeanDescriptionIllegalArgumentExceptionpublic Map<String,AnnotatedMember> findBackReferenceProperties()
public LinkedHashMap<String,AnnotatedField> _findPropertyFields(Collection<String> ignoredProperties, boolean forSerialization)
ignoredProperties - (optional) names of properties to ignore;
any fields that would be recognized as one of these properties
is ignored.forSerialization - If true, will collect serializable property
fields; if false, deserializablepublic LinkedHashMap<String,AnnotatedMethod> findGetters(VisibilityChecker<?> visibilityChecker, Collection<String> ignoredProperties)
findGetters 在类中 BeanDescriptionpublic LinkedHashMap<String,AnnotatedMethod> findSetters(VisibilityChecker<?> visibilityChecker)
findSetters 在类中 BeanDescriptionpublic LinkedHashMap<String,AnnotatedField> findSerializableFields(VisibilityChecker<?> visibilityChecker, Collection<String> ignoredProperties)
findSerializableFields 在类中 BeanDescriptionpublic LinkedHashMap<String,AnnotatedField> findDeserializableFields(VisibilityChecker<?> visibilityChecker, Collection<String> ignoredProperties)
findDeserializableFields 在类中 BeanDescription