|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.jackson.map.BeanDescription
org.codehaus.jackson.map.introspect.BasicBeanDescription
public class BasicBeanDescription
| Field Summary |
|---|
| Fields inherited from class org.codehaus.jackson.map.BeanDescription |
|---|
_type |
| Constructor Summary | |
|---|---|
BasicBeanDescription(JavaType type,
AnnotatedClass ac,
AnnotationIntrospector ai)
|
|
| Method Summary | |
|---|---|
LinkedHashMap<String,AnnotatedField> |
_findPropertyFields(boolean autodetect,
Collection<String> ignoredProperties,
boolean forSerialization)
|
static String |
descFor(AnnotatedElement elem)
Helper method used to describe an annotated element of type Class or Method. |
AnnotatedMethod |
findAnySetter()
Method used to locate the method of introspected class that implements JsonAnySetter. |
Constructor<?> |
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(boolean autodetect,
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(boolean getterAutoDetect,
boolean isGetterAutoDetect,
Collection<String> ignoredProperties)
|
AnnotatedMethod |
findJsonValueMethod()
Method for locating the getter method that is annotated with JsonValue annotation,
if any. |
AnnotatedMethod |
findMethod(String name,
Class<?>[] paramTypes)
|
LinkedHashMap<String,AnnotatedField> |
findSerializableFields(boolean autodetect,
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(boolean autodetect)
|
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) |
AnnotatedClass |
getClassInfo()
|
List<AnnotatedConstructor> |
getConstructors()
|
List<AnnotatedMethod> |
getFactoryMethods()
|
Object |
instantiateBean(boolean fixAccess)
|
protected boolean |
isCglibGetCallbacks(AnnotatedMethod am)
This method was added to address [JACKSON-53]: need to weed out CGLib-injected "getCallbacks". |
protected boolean |
isFactoryMethod(AnnotatedMethod am)
|
protected boolean |
isGroovyMetaClassGetter(AnnotatedMethod am)
Another helper method to deal with rest of [JACKSON-103] |
protected boolean |
isGroovyMetaClassSetter(AnnotatedMethod am)
Similar to isCglibGetCallbacks(org.codehaus.jackson.map.introspect.AnnotatedMethod), need to suppress
a cyclic reference to resolve [JACKSON-103] |
protected String |
mangleGetterName(Annotated a,
String basename)
|
static String |
manglePropertyName(String basename)
Method called to figure out name of the property, given corresponding suggested name based on a method or field name. |
protected String |
mangleSetterName(Annotated a,
String basename)
|
protected String |
okNameForAnyGetter(AnnotatedMethod am,
String name)
|
protected String |
okNameForGetter(AnnotatedMethod am,
String name)
|
protected String |
okNameForIsGetter(AnnotatedMethod am,
String name)
|
protected String |
okNameForSetter(AnnotatedMethod am)
|
| Methods inherited from class org.codehaus.jackson.map.BeanDescription |
|---|
getBeanClass, getType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicBeanDescription(JavaType type,
AnnotatedClass ac,
AnnotationIntrospector ai)
| Method Detail |
|---|
public AnnotatedClass getClassInfo()
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 LinkedHashMap<String,AnnotatedMethod> findGetters(boolean getterAutoDetect,
boolean isGetterAutoDetect,
Collection<String> ignoredProperties)
findGetters in class BeanDescriptiongetterAutoDetect - Whether to use Bean naming convention to
automatically detect bean properties matching 'getXxx' methods
(unless overridden by per-class annotations)isGetterAutoDetect - Whether to use Bean naming convention to
automatically detect boolean bean properties matching 'isXxx' methods
(unless overridden by per-class annotations)ignoredProperties - (optional, may be null) Names of properties
to ignore; getters for these properties are not to be returned.
public AnnotatedMethod findJsonValueMethod()
JsonValue annotation,
if any. If multiple ones are found,
an error is reported by throwing IllegalArgumentException
public Constructor<?> findDefaultConstructor()
public List<AnnotatedConstructor> getConstructors()
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 LinkedHashMap<String,AnnotatedField> findSerializableFields(boolean autodetect,
Collection<String> ignoredProperties)
public JsonSerialize.Inclusion findSerializationInclusion(JsonSerialize.Inclusion defValue)
public LinkedHashMap<String,AnnotatedMethod> findSetters(boolean autodetect)
findSetters in class BeanDescription
public 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.
IllegalArgumentException
public LinkedHashMap<String,AnnotatedField> findDeserializableFields(boolean autodetect,
Collection<String> ignoredProperties)
protected String okNameForAnyGetter(AnnotatedMethod am,
String name)
protected String okNameForGetter(AnnotatedMethod am,
String name)
protected String okNameForIsGetter(AnnotatedMethod am,
String name)
protected String mangleGetterName(Annotated a,
String basename)
protected boolean isCglibGetCallbacks(AnnotatedMethod am)
Also, see [JACKSON-177]; Hibernate may repackage cglib it uses, so we better catch that too
protected boolean isGroovyMetaClassSetter(AnnotatedMethod am)
isCglibGetCallbacks(org.codehaus.jackson.map.introspect.AnnotatedMethod), need to suppress
a cyclic reference to resolve [JACKSON-103]
protected boolean isGroovyMetaClassGetter(AnnotatedMethod am)
protected String okNameForSetter(AnnotatedMethod am)
protected String mangleSetterName(Annotated a,
String basename)
public LinkedHashMap<String,AnnotatedField> _findPropertyFields(boolean autodetect,
Collection<String> ignoredProperties,
boolean forSerialization)
autodetect - Whether to automatically detect public fields
as properties; if true will do that, if false will require
explicit annotations.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
public static String manglePropertyName(String basename)
basename - Name of accessor/mutator method, not including prefix
("get"/"is"/"set")public static String descFor(AnnotatedElement elem)
Class or Method.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||