Annotation Type JsonProperty


  • @Target({ANNOTATION_TYPE,FIELD,METHOD,PARAMETER})
    @Retention(RUNTIME)
    public @interface JsonProperty
    • Element Detail

      • value

        java.lang.String value
        Returns:
        alternative name for the field/getter/setter/parameter
        Default:
        ""
      • from

        java.lang.String[] from
        Returns:
        when bind from multiple possible names, set this
        Default:
        {}
      • to

        java.lang.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

        java.lang.Class<? extends Decoder> decoder
        Returns:
        set different decoder just for this field
        Default:
        com.jsoniter.spi.Decoder.class
      • implementation

        java.lang.Class<?> implementation
        Returns:
        used in decoding only, choose concrete class for interface/abstract type
        Default:
        java.lang.Object.class
      • encoder

        java.lang.Class<? extends Encoder> 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

        java.lang.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:
        ""