JsonProperty (Jackson-annotations 2.0.0 API)
Date: 2012-03-26

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## com.fasterxml.jackson.annotation
Annotation Type JsonProperty

    @Target(value={ANNOTATION_TYPE,FIELD,METHOD,PARAMETER})
    @Retention(value=RUNTIME)
    public @interface JsonProperty

Marker annotation that can be used to define a non-static method as a "setter" or "getter" for a logical property (depending on its signature), or non-static object field to be used (serialized, deserialized) as a logical property.

Default value ("") indicates that the field name is used as the property name without any modifications, but it can be specified to non-empty value to specify different name. Property name refers to name used externally, as the field name in JSON objects.

Optional Element Summary
`boolean` | `required` Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not.
`String` | `value` Defines name of the logical property, i.e.

### value

    public abstract String value

  Defines name of the logical property, i.e. Json object field name to use for the property: if empty String (which is the default), will use name of the field that is annotated.

  Default:
    ""

### required

    public abstract boolean required

  Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not. If expected, `BeanDeserialized` should indicate this as a validity problem (usually by throwing an exception, but this may be sent via problem handlers that can try to rectify the problem, for example, by supplying a default value).

  Note that as of 2.0, this property is NOT used by `BeanDeserializer`: support is expected to be added for later minor versions.

  Since:
    2.0
  Default:
    false

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

Copyright © 2012 fasterxml.com. All Rights Reserved.