public class BasicBeanDescription extends BeanDescription
BeanDescription
implementation used by Jackson.
Although sub-classing is a theoretical possibility there are no known use cases for that, nor is such usage tested or supported. Separation from API is mostly to isolate some implementation details here and keep API simple.
Modifier and Type | Method and Description |
---|---|
java.util.LinkedHashMap<java.lang.String,AnnotatedField> |
_findPropertyFields(java.util.Collection<java.lang.String> ignoredProperties,
boolean forSerialization)
Deprecated.
Since 2.7.2, does not seem to be used?
|
boolean |
addProperty(BeanPropertyDefinition def) |
TypeBindings |
bindingsForBeanType()
Deprecated.
|
AnnotatedMember |
findAnyGetter()
Method used to locate the method of introspected class that
implements
JsonAnyGetter . |
AnnotatedMember |
findAnySetterAccessor()
Method used to locate a mutator (settable field, or 2-argument set method)
of introspected class that
implements
JsonAnySetter . |
java.util.Map<java.lang.String,AnnotatedMember> |
findBackReferenceProperties()
Deprecated.
|
java.util.List<BeanPropertyDefinition> |
findBackReferences()
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.
|
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.
|
java.lang.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.
|
Converter<java.lang.Object,java.lang.Object> |
findDeserializationConverter()
Method for finding
Converter used for serializing instances
of this class. |
JsonFormat.Value |
findExpectedFormat(JsonFormat.Value defValue)
Method for checking what is the expected format for POJO, as
defined by defaults and possible annotations.
|
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.
|
java.util.Map<java.lang.Object,AnnotatedMember> |
findInjectables() |
AnnotatedMember |
findJsonValueAccessor()
Method for locating accessor (readable field, or "getter" method)
that has
JsonValue annotation,
if any. |
AnnotatedMethod |
findJsonValueMethod()
Deprecated.
|
AnnotatedMethod |
findMethod(java.lang.String name,
java.lang.Class<?>[] paramTypes) |
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.
|
JsonPOJOBuilder.Value |
findPOJOBuilderConfig()
Method for finding configuration for POJO Builder class.
|
java.util.List<BeanPropertyDefinition> |
findProperties() |
BeanPropertyDefinition |
findProperty(PropertyName name) |
JsonInclude.Value |
findPropertyInclusion(JsonInclude.Value defValue)
Method for determining whether null properties should be written
out for a Bean of introspected type.
|
Converter<java.lang.Object,java.lang.Object> |
findSerializationConverter()
Method for finding
Converter used for serializing instances
of this class. |
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)
|
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()
Method for accessing low-level information about Class this
item describes.
|
java.util.List<AnnotatedConstructor> |
getConstructors() |
java.util.List<AnnotatedMethod> |
getFactoryMethods() |
java.util.Set<java.lang.String> |
getIgnoredPropertyNames() |
ObjectIdInfo |
getObjectIdInfo()
Accessor for getting information about Object Id expected to
be used for this POJO type, if any.
|
boolean |
hasKnownClassAnnotations()
Method for checking whether class being described has any
annotations recognized by registered annotation introspector.
|
boolean |
hasProperty(PropertyName name) |
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".
|
boolean |
removeProperty(java.lang.String propName)
Method that can be used to prune unwanted properties, during
construction of serializers and deserializers.
|
JavaType |
resolveType(java.lang.reflect.Type jdkType)
Deprecated.
|
findAnySetter, findAnySetterField, getBeanClass, getType, isNonStaticInnerClass
public static BasicBeanDescription forDeserialization(POJOPropertiesCollector coll)
public static BasicBeanDescription forSerialization(POJOPropertiesCollector coll)
public static BasicBeanDescription forOtherUse(MapperConfig<?> config, JavaType type, AnnotatedClass ac)
public boolean removeProperty(java.lang.String propName)
public boolean addProperty(BeanPropertyDefinition def)
public boolean hasProperty(PropertyName name)
public BeanPropertyDefinition findProperty(PropertyName name)
public AnnotatedClass getClassInfo()
BeanDescription
getClassInfo
in class BeanDescription
public ObjectIdInfo getObjectIdInfo()
BeanDescription
getObjectIdInfo
in class BeanDescription
public java.util.List<BeanPropertyDefinition> findProperties()
findProperties
in class BeanDescription
@Deprecated public AnnotatedMethod findJsonValueMethod()
findJsonValueMethod
in class BeanDescription
public AnnotatedMember findJsonValueAccessor()
BeanDescription
JsonValue
annotation,
if any. If multiple ones are found,
an error is reported by throwing IllegalArgumentException
findJsonValueAccessor
in class BeanDescription
public java.util.Set<java.lang.String> getIgnoredPropertyNames()
getIgnoredPropertyNames
in class BeanDescription
public boolean hasKnownClassAnnotations()
BeanDescription
hasKnownClassAnnotations
in class BeanDescription
public Annotations getClassAnnotations()
BeanDescription
getClassAnnotations
in class BeanDescription
@Deprecated public TypeBindings bindingsForBeanType()
BeanDescription
bindingsForBeanType
in class BeanDescription
@Deprecated public JavaType resolveType(java.lang.reflect.Type jdkType)
BeanDescription
resolveType
in class BeanDescription
public AnnotatedConstructor findDefaultConstructor()
BeanDescription
findDefaultConstructor
in class BeanDescription
public AnnotatedMember findAnySetterAccessor() throws java.lang.IllegalArgumentException
BeanDescription
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.findAnySetterAccessor
in class BeanDescription
java.lang.IllegalArgumentException
public java.util.Map<java.lang.Object,AnnotatedMember> findInjectables()
findInjectables
in class BeanDescription
public java.util.List<AnnotatedConstructor> getConstructors()
getConstructors
in class BeanDescription
public java.lang.Object instantiateBean(boolean fixAccess)
BeanDescription
instantiateBean
in class BeanDescription
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 AnnotatedMethod findMethod(java.lang.String name, java.lang.Class<?>[] paramTypes)
findMethod
in class BeanDescription
public JsonFormat.Value findExpectedFormat(JsonFormat.Value defValue)
BeanDescription
findExpectedFormat
in class BeanDescription
public java.lang.Class<?>[] findDefaultViews()
BeanDescription
findDefaultViews
in class BeanDescription
public Converter<java.lang.Object,java.lang.Object> findSerializationConverter()
BeanDescription
Converter
used for serializing instances
of this class.findSerializationConverter
in class BeanDescription
public JsonInclude.Value findPropertyInclusion(JsonInclude.Value defValue)
findPropertyInclusion
in class BeanDescription
public AnnotatedMember findAnyGetter() throws java.lang.IllegalArgumentException
JsonAnyGetter
.
If no such method exists null is returned.
If more than one are found, an exception is thrown.findAnyGetter
in class BeanDescription
java.lang.IllegalArgumentException
public java.util.List<BeanPropertyDefinition> findBackReferences()
BeanDescription
findBackReferences
in class BeanDescription
@Deprecated public java.util.Map<java.lang.String,AnnotatedMember> findBackReferenceProperties()
BeanDescription
findBackReferenceProperties
in class BeanDescription
public java.util.List<AnnotatedMethod> getFactoryMethods()
getFactoryMethods
in class BeanDescription
public java.lang.reflect.Constructor<?> findSingleArgConstructor(java.lang.Class<?>... argTypes)
BeanDescription
findSingleArgConstructor
in class BeanDescription
argTypes
- Type(s) of the argument that we are looking forpublic java.lang.reflect.Method findFactoryMethod(java.lang.Class<?>... expArgTypes)
BeanDescription
findFactoryMethod
in class BeanDescription
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 java.lang.Class<?> findPOJOBuilder()
BeanDescription
findPOJOBuilder
in class BeanDescription
public JsonPOJOBuilder.Value findPOJOBuilderConfig()
BeanDescription
findPOJOBuilderConfig
in class BeanDescription
public Converter<java.lang.Object,java.lang.Object> findDeserializationConverter()
BeanDescription
Converter
used for serializing instances
of this class.findDeserializationConverter
in class BeanDescription
public java.lang.String findClassDescription()
BeanDescription
findClassDescription
in class BeanDescription
@Deprecated public java.util.LinkedHashMap<java.lang.String,AnnotatedField> _findPropertyFields(java.util.Collection<java.lang.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, deserializable"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"