Annotation Type JSONField


When the Key in the JSON does not match the property in the Bean, the conversion process may not meet expectations. JSONField can not only solve this problem but also implement custom requirements.
  • Element Details

    • ordinal

      int ordinal
      The order of the fields during serialization and output in ascending order
      Default:
      0
    • name

      String name
      Specify the String as the key name in JSON
      Default:
      ""
    • format

      String format
      If the field is Date, then please define the date format
      Default:
      ""
    • label

      String label
      Default:
      ""
    • serialize

      boolean serialize
      Whether the field is serialized during serialization, default ture
      Default:
      true
    • deserialize

      boolean deserialize
      Whether the field is deserialized during deserialization, default ture
      Default:
      true
    • unwrapped

      boolean unwrapped
      If true, serialize and deserialize the field's internal properties
      Default:
      false
    • alternateNames

      String[] alternateNames
      Using multiple different field names when deserializing
      Default:
      {}
    • writeUsing

      @Deprecated Class writeUsing
      Deprecated.
      Specifies that ObjectWriter is used when serializing
      Default:
      java.lang.Void.class
    • serializeUsing

      Class serializeUsing
      Specifies that ObjectWriter is used when serializing
      Default:
      java.lang.Void.class
    • deserializeUsing

      Class deserializeUsing
      Specifies that ObjectWriter is used when serializing
      Default:
      java.lang.Void.class
    • deserializeFeatures

      JSONReader.Feature[] deserializeFeatures
      Specify JSONReader.Features to use features when deserializing
      Default:
      {}
    • serializeFeatures

      JSONWriter.Feature[] serializeFeatures
      Specify JSONWriter.Features to use features when serializing output
      Default:
      {}
    • value

      boolean value
      Default:
      false
    • defaultValue

      String defaultValue
      Since:
      1.2.61
      Default:
      ""
    • locale

      String locale
      Default:
      ""
    • schema

      String schema
      Default:
      ""
    • jsonDirect

      boolean jsonDirect
      Default:
      false
    • required

      boolean required
      Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not. If expected, ObjectReader 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).
      Since:
      2.0.20
      Default:
      false