java.lang.Object
tools.jackson.databind.util.BeanUtil
Helper class that contains functionality needed by both serialization
and deserialization side.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcheckUnsupportedType(MapperConfig<?> config, JavaType type) Helper method called byBeanDeserializerFactoryandBeanSerializerFactoryto 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 ObjectgetDefaultValue(JavaType type) Deprecated.static booleanisJodaTimeClass(Class<?> rawType) static ObjectpropertyDefaultValue(MapperConfig<?> config, JavaType type) Short-cut for:static ObjectpropertyDefaultValue(DatabindContext ctxt, JavaType type) Short-cut for:static ObjectpropertyDefaultValue(JavaType type, boolean wrappersAsNulls) 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.static StringstdManglePropertyName(String basename, int offset) Deprecated.since 3.0.0-rc2 UseDefaultAccessorNamingStrategyinstead
-
Constructor Details
-
BeanUtil
public BeanUtil()
-
-
Method Details
-
stdManglePropertyName
Deprecated.since 3.0.0-rc2 UseDefaultAccessorNamingStrategyinstead -
propertyDefaultValue
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, expected defaults (0 for `int`, `false` for `boolean`) are returned; for primitive wrappers (`Integer`, `Boolean`, etc), either `null` or wrapped default for matching primitive is returned (depending on
MapperFeature.WRAPPERS_DEFAULT_TO_NULLsetting); for Strings, empty String; and for structured (Maps, Collections, arrays) and reference types, criteriaJsonInclude.Include.NON_EMPTYis used (to compare to "empty" value)- Parameters:
type- Type for which default value requestedwrappersAsNulls- Iftrue, default for primitive wrapper types likeBooleanwill benull; iffalsewill be wrapped default of matching primitive type (forjava.lang.Booleanthat would beBoolean.FALSE)- Since:
- 3.1
-
propertyDefaultValue
Short-cut for:getDefaultValue(type, ctxt.isEnabled(MapperFeature.WRAPPERS_DEFAULT_TO_NUL));
- Since:
- 3.1
-
propertyDefaultValue
Short-cut for:propertyDefaultValue(type, config.isEnabled(MapperFeature.WRAPPERS_DEFAULT_TO_NUL));
- Since:
- 3.1
-
getDefaultValue
Deprecated.Since 3.1 use one ofpropertyDefaultValue()variants. -
checkUnsupportedType
Helper method called byBeanDeserializerFactoryandBeanSerializerFactoryto 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. -
isJodaTimeClass
-
propertyDefaultValue()variants.