Annotation Interface Validate


Performs basic validations against the String representation of the value found in the annotated field. A validation failure will generate a DataValidationException. By default, nulls and blanks are not allowed.

Commonly used for java beans processed using BeanProcessor and/or BeanWriterProcessor

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Indicates whether this field can be blank (i.e.
    Ensures that the value of this field matches a given regular expression.
    Ensures that the value of this field does is not an unwanted value.
    boolean
    Indicates whether this field can be null
    Ensures that the value of this field is one of a given set of alternatives
    Class<? extends Validator>[]
    User provided implementations of Validator which will be executed in sequence after the validations specified in this annotation execute.
  • Element Details

    • nullable

      boolean nullable
      Indicates whether this field can be null
      Returns:
      true true if nulls are allowed, false otherwise
      Default:
      false
    • allowBlanks

      boolean allowBlanks
      Indicates whether this field can be blank (i.e. contain 0 or more whitespaces, where a whitespace is any character <= ' '
      Returns:
      true true if blanks are allowed, false otherwise
      Default:
      false
    • matches

      String matches
      Ensures that the value of this field matches a given regular expression.
      Returns:
      the regular expression that determines an expected format for the given value
      Default:
      ""
    • oneOf

      String[] oneOf
      Ensures that the value of this field is one of a given set of alternatives
      Returns:
      the sequence of allowed values
      Default:
      {}
    • noneOf

      String[] noneOf
      Ensures that the value of this field does is not an unwanted value.
      Returns:
      the sequence of disallowed values
      Default:
      {}
    • validators

      Class<? extends Validator>[] validators
      User provided implementations of Validator which will be executed in sequence after the validations specified in this annotation execute.
      Returns:
      custom classes to be used to validate any value associated with this field.
      Default:
      {}