Annotation Type ApiProperty


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface ApiProperty
Registers a property getter with the API framework. When a model is serialized the property is included in the properties section of the serialized JSON.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Defines the scope in which the property is being serialized in.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Boolean used when a method or field is a Map of name/value pairs.
    The name of the property to be serialized.
    The scope in which the property should be serialized.
  • Element Details

    • name

      String name
      The name of the property to be serialized. If the name isn't explicity specified, then the name of the method or field is used in lowercase, with prefixes "get" or "is" removed.
      Returns:
      The name of the property
      Default:
      ""
    • scope

      The scope in which the property should be serialized. If SCOPE.RESOURCE the property will be serialized for a resource that is the main entity. If SCOPE.INLINE the property will be serialized for a resource that is a sub-entity of another resource. By default the property will be serialized in both cases.
      Returns:
      The scope in which this property should be serialized.
      Default:
      BOTH
    • flattenMap

      boolean flattenMap
      Boolean used when a method or field is a Map of name/value pairs. If true the properties contained in the Map will be serialized each on their own at the top level of the properties section of the entity. If false, the Map will be serialzied as a single property in the property section.
      Returns:
      Whether or not to flatten a map in the properties section
      Default:
      false