AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() See example snippet in Deserialization Features Requires config READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE feature to be enabled. ![]() (added in 2.8): annotation used for defining a default value when deserializing unknown Enum values.alternative to for marking that specified method is a "setter-method".annotation used for indicating that a constructor or static factory method should be used for creating value instances during deserialization.annotation used for defining a two-argument method as "any setter", used for deserializing values of otherwise unmapped JSON properties.annotation to indicate that property should get its value via "injection", and not from data (JSON).property annotation used for defining View(s) in which property will be included for serialization, deserialization.property annotation used to define that value should be "unwrapped" when serialized (and wrapped again when deserializing), resulting in flattening of data structure, compared to POJO structure.general annotation that has per-type behavior can be used for example to specify format to use when serializing Date/Time values.Not use by core databinding, but is used by JSON Schema generator for adding description in schema.ĭeserialization and Serialization details.(added in 2.3): Annotation used to define a human readable description for a logical property.annotation used to define if certain "non-values" (nulls or empty values) should not be included when serializing can be used on per-property basis as well as default for a class (to be used for all properties of a class).per-class annotation to indicate that all properties of annotated type are to be ignored.On deserialization, ignores properties that don't have getter/setters.On serialization, "prop2"}) ignores listed properties.per-class annotation to list properties to ignore, or to indicate that any unknown properties are to be ignored.unless "setter" has in which case this is considered a "split property" with enabled "setter" but no "getter" ("read-only", so that property may be read from input, but is not written output) Only needs to be added to one of accessors/mutators (field, getter/setter, constructor parameter), but will have effect on the "whole" property: that is, adding annotation to a "getter" will also disable "setter".simple annotation to use for ignoring specified properties:.DEFAULT: pseudo-value indicating "use global defaults" (also default value for above-listed annotation properties).NONE: accessor of implied type never auto-detected.PUBLIC_ONLY: accessor of implied type auto-detected only if it is public.PROTECTED_AND_PUBLIC: accessor of implied type auto-detected if it is either public or protected.NON_PRIVATE: accessor of implied type auto-detected if its visibility is anything other than private.ANY: accessor of implied type auto-detected regardless of its visibility.All properties use Visibility level as value:.setterVisibility for detecting "setters": single-argument taking methods with name starting with "set"-prefix.isGetterVisibility for detecting boolean/ Boolean-returning, no-argument methods with names starting with "is"-prefix.getterVisibility for detecting "getters": no-argument value returning methods with names starting with "get"-prefix.fieldVisibility for detecting Java object fields.creatorVisibility for detecting Constructors as Creator methods (and for small number of "well-known" static factory methods like valueOf()).Settings for different accessor types using separate properties:.class annotation used for overriding property introspection definitions.NOTE: core databind does NOT make any use of this value it is currently only exposed to extension modules. textual default value defined as metadata.physical index to use, if dataformat (other than JSON) is index-based.(also indicates that property is to be included) is used to indicate external property name, name used in data format (JSON or one of other supported data formats).NOTE: Contributions welcome!!! Property Naming This page lists all general-purpose Jackson 2.0 annotations, grouped by functionality.Īll annotations include a brief explanation, and (in near future!) a link to full explanation with basic usage examples.
0 Comments
Read More
Leave a Reply. |