Annotation Interface FieldDescriptor


@Target(FIELD) @Retention(RUNTIME) public @interface FieldDescriptor
Annotation for a field in a model to control how that field should be handled in an editor e.g. whether it should be visible, the associated unit, minimum/maximum permitted value etc.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
    If the field is a String, java.io.File, java.nio.file.Path or IResource you may use this annotation to define the type of checking which will be done.
     
    The label attribute.
    double
    If scannable is set, this value overrides the maximum of the scannble, otherwise the scannable is used.
    double
    If scannable is set, this value overrides the minimum of the scannble, otherwise the scannable is used.
    The number format to format a field editing a number
    If scannable is set, this value overrides the unit of the scannble, otherwise the scannable unit is used.
    boolean
     
  • Element Details

    • visible

      boolean visible
      Returns:
      true if the field is visible in the UI
      Default:
      true
    • editable

      boolean editable
      Returns:
      true if the field is editable or false for read only.
      Default:
      true
    • label

      String label
      The label attribute. If unset, uses the name of the field for the label.
      Default:
      ""
    • maximum

      double maximum
      If scannable is set, this value overrides the maximum of the scannble, otherwise the scannable is used.
      Returns:
      maximum allowed legal value for field
      Default:
      1.0/0.0
    • minimum

      double minimum
      If scannable is set, this value overrides the minimum of the scannble, otherwise the scannable is used.
      Returns:
      minimum allowed legal value for field
      Default:
      -1.0/0.0
    • unit

      String unit
      If scannable is set, this value overrides the unit of the scannble, otherwise the scannable unit is used.
      Returns:
      the unit that the fields value should be in.
      Default:
      ""
    • hint

      String hint
      Returns:
      the string hint which is shown to the user when they first edit the value.
      Default:
      ""
    • file

      FileType file
      If the field is a String, java.io.File, java.nio.file.Path or IResource you may use this annotation to define the type of checking which will be done.

      If this field is not used and your field is a File for instance, the NEW_FILE option will be the default, rather than NONE

      Returns:
      the file type.
      Default:
      NONE
    • numberFormat

      String numberFormat
      The number format to format a field editing a number
      Default:
      ""