Package com.jsoniter.annotation
Annotation Type JsonProperty
@Target({ANNOTATION_TYPE,FIELD,METHOD,PARAMETER})
@Retention(RUNTIME)
public @interface JsonProperty
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String value- Returns:
- alternative name for the field/getter/setter/parameter
- Default:
""
-
from
String[] from- Returns:
- when bind from multiple possible names, set this
- Default:
{}
-
to
String[] to- Returns:
- when one field will write to multiple object fields, set this
- Default:
{}
-
required
boolean required- Returns:
- used in decoding only, the field must present in the JSON, regardless null or not
- Default:
false
-
decoder
- Returns:
- set different decoder just for this field
- Default:
com.jsoniter.spi.Decoder.class
-
implementation
Class<?> implementation- Returns:
- used in decoding only, choose concrete class for interface/abstract type
- Default:
java.lang.Object.class
-
encoder
- Returns:
- set different encoder just for this field
- Default:
com.jsoniter.spi.Encoder.class
-
nullable
boolean nullable- Returns:
- used in encoding only, should check null for this field, skip null checking will make encoding faster
- Default:
true
-
collectionValueNullable
boolean collectionValueNullable- Returns:
- used in encoding only, should check null for the value, if it is collection, skip null checking will make encoding faster
- Default:
true
-
defaultValueToOmit
String defaultValueToOmit- Returns:
- the default value to omit null, to omit null value \"xxx\", to omit string value 123, to omit number void, to always encode this field, ignore global config
- Default:
""
-