Class BeanUtil
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.util.BeanUtil
Helper class that contains functionality needed by both serialization
and deserialization side.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
checkUnsupportedType
(JavaType type) Helper method called byBeanDeserializerFactory
andBeanSerializerFactory
to check if given unrecognized type (to be (de)serialized as general POJO) is one of "well-known" types for which there would be a datatype module; and if so, return appropriate failure message to give to caller.static 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
.protected static boolean
This method was added to address the need to weed out CGLib-injected "getCallbacks" method.protected static boolean
Another helper method to deal with Groovy's problematic metadata accessorsstatic boolean
isJava8TimeClass
(Class<?> rawType) static boolean
isJodaTimeClass
(Class<?> rawType) protected static String
legacyManglePropertyName
(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 String
okNameForGetter
(AnnotatedMethod am, boolean stdNaming) Deprecated.static String
okNameForIsGetter
(AnnotatedMethod am, String name, boolean stdNaming) Deprecated.Since 2.12 replaced withAccessorNamingStrategy
static String
okNameForMutator
(AnnotatedMethod am, String prefix, boolean stdNaming) Deprecated.Since 2.12 replaced withAccessorNamingStrategy
static String
okNameForRegularGetter
(AnnotatedMethod am, String name, boolean stdNaming) Deprecated.Since 2.12 replaced withAccessorNamingStrategy
static String
okNameForSetter
(AnnotatedMethod am, boolean stdNaming) Deprecated.static String
stdManglePropertyName
(String basename, int offset) Note: public only since 2.11
-
Constructor Details
-
BeanUtil
public BeanUtil()
-
-
Method Details
-
okNameForGetter
Deprecated.Since 2.12 replaced withAccessorNamingStrategy
- Since:
- 2.5
-
okNameForRegularGetter
@Deprecated public static String okNameForRegularGetter(AnnotatedMethod am, String name, boolean stdNaming) Deprecated.Since 2.12 replaced withAccessorNamingStrategy
- Since:
- 2.5
-
okNameForIsGetter
@Deprecated public static String okNameForIsGetter(AnnotatedMethod am, String name, boolean stdNaming) Deprecated.Since 2.12 replaced withAccessorNamingStrategy
- Since:
- 2.5
-
okNameForSetter
Deprecated. -
okNameForMutator
@Deprecated public static String okNameForMutator(AnnotatedMethod am, String prefix, boolean stdNaming) Deprecated.Since 2.12 replaced withAccessorNamingStrategy
- Since:
- 2.5
-
getDefaultValue
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_DEFAULT
is used.- Since:
- 2.7
-
isCglibGetCallbacks
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[]" -
isGroovyMetaClassGetter
Another helper method to deal with Groovy's problematic metadata accessors -
legacyManglePropertyName
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
Note: public only since 2.11- Since:
- 2.5
-
checkUnsupportedType
Helper method called byBeanDeserializerFactory
andBeanSerializerFactory
to check if given unrecognized type (to be (de)serialized as general POJO) is one of "well-known" types for which there would be a datatype module; and if so, return appropriate failure message to give to caller.- Since:
- 2.12
-
isJava8TimeClass
- Since:
- 2.12
-
isJodaTimeClass
- Since:
- 2.12
-
AccessorNamingStrategy