Class BeanUtil
- java.lang.Object
-
- com.fasterxml.jackson.databind.util.BeanUtil
-
public class BeanUtil extends java.lang.ObjectHelper class that contains functionality needed by both serialization and deserialization side.
-
-
Constructor Summary
Constructors Constructor Description BeanUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.ObjectgetDefaultValue(JavaType type)Accessor used to find out "default value" to use for comparing values to serialize, to determine whether to exclude value from serialization with inclusion type ofJsonInclude.Include.NON_DEFAULT.protected static booleanisCglibGetCallbacks(AnnotatedMethod am)This method was added to address the need to weed out CGLib-injected "getCallbacks" method.protected static booleanisGroovyMetaClassGetter(AnnotatedMethod am)Another helper method to deal with Groovy's problematic metadata accessorsprotected static booleanisGroovyMetaClassSetter(AnnotatedMethod am)Similar toisCglibGetCallbacks(com.fasterxml.jackson.databind.introspect.AnnotatedMethod), need to suppress a cyclic reference.protected static java.lang.StringlegacyManglePropertyName(java.lang.String basename, int offset)Method called to figure out name of the property, given corresponding suggested name based on a method or field name.static java.lang.StringokNameForGetter(AnnotatedMethod am, boolean stdNaming)static java.lang.StringokNameForIsGetter(AnnotatedMethod am, java.lang.String name, boolean stdNaming)static java.lang.StringokNameForMutator(AnnotatedMethod am, java.lang.String prefix, boolean stdNaming)static java.lang.StringokNameForRegularGetter(AnnotatedMethod am, java.lang.String name, boolean stdNaming)static java.lang.StringokNameForSetter(AnnotatedMethod am, boolean stdNaming)Deprecated.protected static java.lang.StringstdManglePropertyName(java.lang.String basename, int offset)
-
-
-
Method Detail
-
okNameForGetter
public static java.lang.String okNameForGetter(AnnotatedMethod am, boolean stdNaming)
- Since:
- 2.5
-
okNameForRegularGetter
public static java.lang.String okNameForRegularGetter(AnnotatedMethod am, java.lang.String name, boolean stdNaming)
- Since:
- 2.5
-
okNameForIsGetter
public static java.lang.String okNameForIsGetter(AnnotatedMethod am, java.lang.String name, boolean stdNaming)
- Since:
- 2.5
-
okNameForSetter
@Deprecated public static java.lang.String okNameForSetter(AnnotatedMethod am, boolean stdNaming)
Deprecated.- Since:
- 2.5
-
okNameForMutator
public static java.lang.String okNameForMutator(AnnotatedMethod am, java.lang.String prefix, boolean stdNaming)
- Since:
- 2.5
-
getDefaultValue
public static java.lang.Object getDefaultValue(JavaType type)
Accessor used to find out "default value" to use for comparing values to serialize, to determine whether to exclude value from serialization with inclusion type ofJsonInclude.Include.NON_DEFAULT.Default logic is such that for primitives and wrapper types for primitives, expected defaults (0 for `int` and `java.lang.Integer`) are returned; for Strings, empty String, and for structured (Maps, Collections, arrays) and reference types, criteria
JsonInclude.Include.NON_DEFAULTis used.- Since:
- 2.7
-
isCglibGetCallbacks
protected static boolean isCglibGetCallbacks(AnnotatedMethod am)
This method was added to address the need to weed out CGLib-injected "getCallbacks" method. At this point caller has detected a potential getter method with name "getCallbacks" and we need to determine if it is indeed injectect by Cglib. We do this by verifying that the result type is "net.sf.cglib.proxy.Callback[]"
-
isGroovyMetaClassSetter
protected static boolean isGroovyMetaClassSetter(AnnotatedMethod am)
Similar toisCglibGetCallbacks(com.fasterxml.jackson.databind.introspect.AnnotatedMethod), need to suppress a cyclic reference.
-
isGroovyMetaClassGetter
protected static boolean isGroovyMetaClassGetter(AnnotatedMethod am)
Another helper method to deal with Groovy's problematic metadata accessors
-
legacyManglePropertyName
protected static java.lang.String legacyManglePropertyName(java.lang.String basename, int offset)Method called to figure out name of the property, given corresponding suggested name based on a method or field name.- Parameters:
basename- Name of accessor/mutator method, not including prefix ("get"/"is"/"set")
-
stdManglePropertyName
protected static java.lang.String stdManglePropertyName(java.lang.String basename, int offset)- Since:
- 2.5
-
-