Annotation Interface ConditionalNotEmpty


Checks if specified itemPropertyPath is empty only when condition is satisfied.
  • Element Details

    • propertyPath

      String[] propertyPath
      Validated field.

      Its name is propertyPath, not field because basically you set field names (like 'name'), but you can also set a field in a bean (like 'dept.name').

      Returns:
      propertyPath
    • conditionPropertyPath

      String conditionPropertyPath
      Conditional field. Validation check is executed only when the value of this field is equal to the value which fieldWhichHoldsConditionalValue holds.

      Its name is conditionPropertyPath, not conditionField because basically you set field names (like 'name'), but you can also set a field in a bean (like 'dept.name').

      Returns:
      condition field name
    • conditionPattern

      ConditionValuePattern conditionPattern
      Specifies how to determine condition is valid.

      For example, we can say condition is satisfied when the value of conditionField is not empty, or the value of conditionField is equal to "a".
      This field specifies how to determine that the condition is satisfied.

      Returns:
      ConditionPattern
    • conditionOperator

      ConditionOperator conditionOperator
      Specifies the operator applied between the value of a condition field and the condition value To decide whether the condition is satisfied.
      Returns:
      ConditionOperator
      Default:
      equalTo
    • conditionValueString

      String[] conditionValueString
      Specifies condition value string.

      This is used when HowToDetermineConditionIsValid is either stringValueOfConditionFieldIsEqualTo or stringValueOfConditionFieldIsNotEqualTo. Otherwise it must be unset.

      When stringValueOfConditionFieldIsEqualTo is selected, a condition is considered to be satisfied if one of the values of this field is equal to the value of conditionField.
      When stringValueOfConditionFieldIsNotEqualTo is selected, a condition is considered to be satisfied if all of the values of this field is NOT equal to the value of conditionField.

      You can use stringValueOfConditionFieldIsEqualTo and stringValueOfConditionFieldIsNotEqualTo only when the datatype of conditionField is string. Otherwise you need to choose other choice.

      Returns:
      an array of string values
      Default:
      {"[null]"}
    • conditionValuePropertyPath

      String conditionValuePropertyPath
      Specifies condition value field.

      This is used when valueOfPropertyPath is valueOfPropertyPath. Otherwise it must be unset.

      The datatype of the field specifies conditionValueField can be an array.

      When ConditionOperator.equalTo is selected, a condition is considered to be satisfied if one of the values of the field conditionValueField specifies is equal to the value of conditionField.
      When ConditionOperator.notEqualTo is selected, a condition is considered to be satisfied if all of the values of the field conditionValueField specifies is NOT equal to the value of conditionField.

      Returns:
      an array of string values
      Default:
      "[null]"
    • displayStringPropertyPathOfConditionValuePropertyPath

      String displayStringPropertyPathOfConditionValuePropertyPath
      Specifies a field which holds the display name of condition value.

      It can be an array datatype which has multiple values.
      When the value is new String[] {""}, the condionValue specified is displayed as a part of an error message.

      Returns:
      String
      Default:
      ""
    • emptyWhenConditionNotSatisfied

      boolean emptyWhenConditionNotSatisfied
      Decides whether validation check is executed when the value of conditionField is not equal to the specified value.
      Returns:
      boolean
      Default:
      false
    • message

      String message
      Returns message ID.
      Returns:
      message ID
      Default:
      "{jp.ecuacion.validation.constraints.ConditionalNotEmpty.message}"
    • groups

      Class<?>[] groups
      Returns groups.
      Returns:
      groups
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Returns payload.
      Returns:
      payload
      Default:
      {}