Annotation Interface PermazenListField


@Retention(RUNTIME) @Target({ANNOTATION_TYPE,METHOD}) @Documented public @interface PermazenListField
Java annotation for the getter methods of Java bean properties reflecting List fields.

The annotated method's return type must be List<E>, where E is a supported simple type.

List fields have a "random access" performance profile similar to an ArrayList. In particular, List.get() and List.size() are constant time, but an insertion in the middle of the list requires shifting all subsequent values by one.

Note that both primitive types and their corresponding wrapper types are supported as elements. A list whose elements have primitive type will throw an exception on an attempt to add a null value. To specify a primitive element type, specify the primitive type name (e.g., "int") as the PermazenField.encoding() in the element().

Meta-Annotations

This annotation may be configured indirectly as a Spring meta-annotation when spring-core is on the classpath.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Configuration for the field's elements.
    The name of this field.
    int
    Storage ID for this field.
  • Element Details

    • name

      String name
      The name of this field.

      If empty string (default value), the name is inferred from the name of the annotated Java bean getter method.

      Returns:
      the list field name
      Default:
      ""
    • storageId

      int storageId
      Storage ID for this field.

      Normally this value is left as zero, in which case a value will be automatically assigned.

      Otherwise, the value should be positive and unique within the contained class.

      Returns:
      the field's storage ID, or zero for automatic assignment
      Default:
      0
    • element

      PermazenField element
      Configuration for the field's elements.

      Normally this property only needs to be set to index the sub-field. If set, the name property must be left unset.

      Returns:
      configuration for the list element sub-field
      Default:
      @io.permazen.annotation.PermazenField