Annotation Type JSONAttribute


@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface JSONAttribute
Marks a JSON attribute for serialization.
Since:
1.0.0
Version:
2.1.0
Author:
Ralph Niemitz/RalleYTN(ralph.niemitz@gmx.de)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents the type of an attribute.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Defines the
    JSONAttribute.Type.GETTER is used for serializing an object.
  • Element Details

    • name

      String name
      Returns:
      the name of the attribute
      Since:
      1.0.0
    • type

      JSONAttribute.Type.GETTER is used for serializing an object. If it is used on a method, it is not allowed to have any parameters! JSONAttribute.Type.SETTER is used for deserializing an object. If it is used on a method, it can only have one parameter! If this Annotation is used on a field, it has to be accessible!
      Returns:
      the attribute type
      Since:
      1.0.0
      Default:
      {GETTER, SETTER}
    • genericType

      Class<?> genericType
      Defines the
      Returns:
      the generic type for the values within the attribute for correct mapping during deserialization.
      Since:
      2.1.0
      Default:
      void.class