public abstract class BeanDescription extends Object
ClassIntrospector
to
help in constructing serializers and deserializers.
Note that the main implementation type is
BasicBeanDescription
,
meaning that it is safe to upcast to this type.Modifier and Type | Field and Description |
---|---|
protected JavaType |
_type
Bean type information, including raw class and possible
generics information
|
Modifier | Constructor and Description |
---|---|
protected |
BeanDescription(JavaType type) |
Modifier and Type | Method and Description |
---|---|
abstract TypeBindings |
bindingsForBeanType()
Deprecated.
Since 2.7, should not need to access bindings directly
|
abstract AnnotatedMember |
findAnyGetter() |
AnnotatedMethod |
findAnySetter()
Deprecated.
Since 2.9: use
findAnySetterAccessor() instead |
abstract AnnotatedMember |
findAnySetterAccessor()
Method used to locate a mutator (settable field, or 2-argument set method)
of introspected class that
implements
JsonAnySetter . |
AnnotatedMember |
findAnySetterField()
Deprecated.
Since 2.9: use
findAnySetterAccessor() instead |
abstract Map<String,AnnotatedMember> |
findBackReferenceProperties()
Deprecated.
Since 2.9 use
findBackReferences() instead |
abstract List<BeanPropertyDefinition> |
findBackReferences()
Method for locating all back-reference properties (setters, fields) bean has
|
String |
findClassDescription()
Accessor for possible description for the bean type, used for constructing
documentation.
|
abstract 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.
|
abstract Class<?>[] |
findDefaultViews()
Method for finding out if the POJO specifies default view(s) to
use for properties, considering both per-type annotations and
global default settings.
|
abstract Converter<Object,Object> |
findDeserializationConverter()
Method for finding
Converter used for serializing instances
of this class. |
abstract JsonFormat.Value |
findExpectedFormat(JsonFormat.Value defValue)
Method for checking what is the expected format for POJO, as
defined by defaults and possible annotations.
|
abstract Method |
findFactoryMethod(Class<?>... expArgTypes)
Deprecated.
Since 2.13: instead use
getFactoryMethods() , filter. |
abstract Map<Object,AnnotatedMember> |
findInjectables() |
AnnotatedMember |
findJsonKeyAccessor()
Method for locating accessor (readable field, or "getter" method)
that has
JsonKey annotation,
if any. |
abstract AnnotatedMember |
findJsonValueAccessor()
Method for locating accessor (readable field, or "getter" method)
that has
JsonValue annotation,
if any. |
abstract AnnotatedMethod |
findJsonValueMethod()
Deprecated.
|
abstract AnnotatedMethod |
findMethod(String name,
Class<?>[] paramTypes) |
abstract Class<?> |
findPOJOBuilder()
Method for checking if the POJO type has annotations to
indicate that a builder is to be used for instantiating
instances and handling data binding, instead of standard
bean deserializer.
|
abstract JsonPOJOBuilder.Value |
findPOJOBuilderConfig()
Method for finding configuration for POJO Builder class.
|
abstract List<BeanPropertyDefinition> |
findProperties() |
abstract JsonInclude.Value |
findPropertyInclusion(JsonInclude.Value defValue)
Method for finding annotation-indicated inclusion definition (if any);
possibly overriding given default value.
|
abstract Converter<Object,Object> |
findSerializationConverter()
Method for finding
Converter used for serializing instances
of this class. |
abstract Constructor<?> |
findSingleArgConstructor(Class<?>... argTypes)
Deprecated.
Since 2.13: instead use
getConstructors() , filter. |
Class<?> |
getBeanClass() |
abstract Annotations |
getClassAnnotations()
Method for accessing collection of annotations the bean
class has.
|
abstract AnnotatedClass |
getClassInfo()
Method for accessing low-level information about Class this
item describes.
|
abstract List<AnnotatedConstructor> |
getConstructors()
Helper method that will return all non-default constructors (that is,
constructors that take one or more arguments) this class has.
|
abstract List<AnnotatedAndMetadata<AnnotatedConstructor,JsonCreator.Mode>> |
getConstructorsWithMode()
Method similar to
getConstructors() except will also introspect
JsonCreator.Mode and filter out ones marked as not applicable and
include mode (or lack thereof) for remaining constructors. |
abstract List<AnnotatedMethod> |
getFactoryMethods()
Helper method that will check all static methods of the bean class
that seem like factory methods eligible to be used as Creators.
|
abstract List<AnnotatedAndMetadata<AnnotatedMethod,JsonCreator.Mode>> |
getFactoryMethodsWithMode()
Method similar to
getFactoryMethods() but will return JsonCreator.Mode
metadata along with qualifying factory method candidates. |
abstract Set<String> |
getIgnoredPropertyNames() |
abstract ObjectIdInfo |
getObjectIdInfo()
Accessor for getting information about Object Id expected to
be used for this POJO type, if any.
|
JavaType |
getType()
Method for accessing declared type of bean being introspected,
including full generic type information (from declaration)
|
abstract boolean |
hasKnownClassAnnotations()
Method for checking whether class being described has any
annotations recognized by registered annotation introspector.
|
abstract 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".
|
boolean |
isNonStaticInnerClass() |
abstract JavaType |
resolveType(Type jdkType)
Deprecated.
Since 2.8, should simply call
getType of
property accessor directly. |
protected final JavaType _type
protected BeanDescription(JavaType type)
public JavaType getType()
public Class<?> getBeanClass()
public boolean isNonStaticInnerClass()
public abstract AnnotatedClass getClassInfo()
public abstract ObjectIdInfo getObjectIdInfo()
public abstract boolean hasKnownClassAnnotations()
@Deprecated public abstract TypeBindings bindingsForBeanType()
@Deprecated public abstract JavaType resolveType(Type jdkType)
getType
of
property accessor directly.public abstract Annotations getClassAnnotations()
public abstract List<BeanPropertyDefinition> findProperties()
public abstract List<BeanPropertyDefinition> findBackReferences()
@Deprecated public abstract Map<String,AnnotatedMember> findBackReferenceProperties()
findBackReferences()
insteadpublic abstract List<AnnotatedConstructor> getConstructors()
public abstract List<AnnotatedAndMetadata<AnnotatedConstructor,JsonCreator.Mode>> getConstructorsWithMode()
getConstructors()
except will also introspect
JsonCreator.Mode
and filter out ones marked as not applicable and
include mode (or lack thereof) for remaining constructors.
Note that no other filtering (regarding visibility or other annotations) is performed
public abstract List<AnnotatedMethod> getFactoryMethods()
@JsonCreator
OR naming:
names valueOf()
and fromString()
are recognized but
only for 1-argument factory methods, and in case of fromString()
argument type must further be either String
or CharSequence
.
public abstract List<AnnotatedAndMetadata<AnnotatedMethod,JsonCreator.Mode>> getFactoryMethodsWithMode()
getFactoryMethods()
but will return JsonCreator.Mode
metadata along with qualifying factory method candidates.public abstract AnnotatedConstructor findDefaultConstructor()
@Deprecated public abstract Constructor<?> findSingleArgConstructor(Class<?>... argTypes)
getConstructors()
, filter.@Deprecated public abstract Method findFactoryMethod(Class<?>... expArgTypes)
getFactoryMethods()
, filter.public AnnotatedMember findJsonKeyAccessor()
JsonKey
annotation,
if any. If multiple ones are found,
an error is reported by throwing IllegalArgumentException
public abstract AnnotatedMember findJsonValueAccessor()
JsonValue
annotation,
if any. If multiple ones are found,
an error is reported by throwing IllegalArgumentException
public abstract AnnotatedMember findAnyGetter()
public abstract AnnotatedMember findAnySetterAccessor()
JsonAnySetter
.
If no such mutator 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.public abstract AnnotatedMethod findMethod(String name, Class<?>[] paramTypes)
@Deprecated public abstract AnnotatedMethod findJsonValueMethod()
@Deprecated public AnnotatedMethod findAnySetter()
findAnySetterAccessor()
instead@Deprecated public AnnotatedMember findAnySetterField()
findAnySetterAccessor()
insteadpublic abstract JsonInclude.Value findPropertyInclusion(JsonInclude.Value defValue)
NOTE: does NOT use global inclusion default settings as the base, unless passed as `defValue`.
public abstract JsonFormat.Value findExpectedFormat(JsonFormat.Value defValue)
public abstract Converter<Object,Object> findSerializationConverter()
Converter
used for serializing instances
of this class.public abstract Converter<Object,Object> findDeserializationConverter()
Converter
used for serializing instances
of this class.public String findClassDescription()
public abstract Map<Object,AnnotatedMember> findInjectables()
public abstract Class<?> findPOJOBuilder()
public abstract JsonPOJOBuilder.Value findPOJOBuilderConfig()
public abstract 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 abstract Class<?>[] findDefaultViews()
Copyright © 2008–2022 FasterXML. All rights reserved.