public abstract class BeanDescription
extends java.lang.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, use
resolveType(java.lang.reflect.Type) instead. |
abstract AnnotatedMember |
findAnyGetter() |
abstract AnnotatedMethod |
findAnySetter()
Method used to locate the method of introspected class that
implements
JsonAnySetter . |
abstract java.util.Map<java.lang.String,AnnotatedMember> |
findBackReferenceProperties()
Method for locating all back-reference properties (setters, fields) bean has
|
java.lang.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 Converter<java.lang.Object,java.lang.Object> |
findDeserializationConverter()
Method for finding
Converter used for serializing instances
of this class. |
abstract com.fasterxml.jackson.annotation.JsonFormat.Value |
findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat.Value defValue)
Method for checking what is the expected format for POJO, as
defined by defaults and possible annotations.
|
abstract java.lang.reflect.Method |
findFactoryMethod(java.lang.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.
|
abstract java.util.Map<java.lang.Object,AnnotatedMember> |
findInjectables() |
abstract AnnotatedMethod |
findJsonValueMethod()
Method for locating the getter method that is annotated with
JsonValue annotation,
if any. |
abstract AnnotatedMethod |
findMethod(java.lang.String name,
java.lang.Class<?>[] paramTypes) |
abstract java.lang.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 java.util.List<BeanPropertyDefinition> |
findProperties() |
abstract com.fasterxml.jackson.annotation.JsonInclude.Value |
findPropertyInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value defValue) |
abstract Converter<java.lang.Object,java.lang.Object> |
findSerializationConverter()
Method for finding
Converter used for serializing instances
of this class. |
abstract java.lang.reflect.Constructor<?> |
findSingleArgConstructor(java.lang.Class<?>... argTypes)
Method that can be called to locate a single-arg constructor that
takes specified exact type (will not accept supertype constructors)
|
java.lang.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 java.util.List<AnnotatedConstructor> |
getConstructors() |
abstract java.util.List<AnnotatedMethod> |
getFactoryMethods() |
abstract java.util.Set<java.lang.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 java.lang.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".
|
abstract JavaType |
resolveType(java.lang.reflect.Type jdkType)
Method for resolving given JDK type, using this bean as the
generic type resolution context.
|
protected final JavaType _type
protected BeanDescription(JavaType type)
public JavaType getType()
public java.lang.Class<?> getBeanClass()
public abstract AnnotatedClass getClassInfo()
public abstract ObjectIdInfo getObjectIdInfo()
public abstract boolean hasKnownClassAnnotations()
@Deprecated public abstract TypeBindings bindingsForBeanType()
resolveType(java.lang.reflect.Type)
instead.public abstract JavaType resolveType(java.lang.reflect.Type jdkType)
public abstract Annotations getClassAnnotations()
public abstract java.util.List<BeanPropertyDefinition> findProperties()
public abstract java.util.Map<java.lang.String,AnnotatedMember> findBackReferenceProperties()
public abstract java.util.Set<java.lang.String> getIgnoredPropertyNames()
public abstract java.util.List<AnnotatedConstructor> getConstructors()
public abstract java.util.List<AnnotatedMethod> getFactoryMethods()
public abstract AnnotatedConstructor findDefaultConstructor()
public abstract java.lang.reflect.Constructor<?> findSingleArgConstructor(java.lang.Class<?>... argTypes)
argTypes
- Type(s) of the argument that we are looking forpublic abstract java.lang.reflect.Method findFactoryMethod(java.lang.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)public abstract AnnotatedMember findAnyGetter()
public abstract AnnotatedMethod findAnySetter()
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.public abstract AnnotatedMethod findJsonValueMethod()
JsonValue
annotation,
if any. If multiple ones are found,
an error is reported by throwing IllegalArgumentException
public abstract AnnotatedMethod findMethod(java.lang.String name, java.lang.Class<?>[] paramTypes)
public abstract com.fasterxml.jackson.annotation.JsonInclude.Value findPropertyInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value defValue)
public abstract com.fasterxml.jackson.annotation.JsonFormat.Value findExpectedFormat(com.fasterxml.jackson.annotation.JsonFormat.Value defValue)
public abstract Converter<java.lang.Object,java.lang.Object> findSerializationConverter()
Converter
used for serializing instances
of this class.public abstract Converter<java.lang.Object,java.lang.Object> findDeserializationConverter()
Converter
used for serializing instances
of this class.public java.lang.String findClassDescription()
public abstract java.util.Map<java.lang.Object,AnnotatedMember> findInjectables()
public abstract java.lang.Class<?> findPOJOBuilder()
public abstract JsonPOJOBuilder.Value findPOJOBuilderConfig()
public abstract java.lang.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.