Annotation Interface ConditionalNotEmpty
itemPropertyPath is empty only when condition is satisfied.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines severalConditionalNotEmptyannotations on the same element. -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionSpecifies how to determine condition is valid.Conditional field.String[]Validated field. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies the operator applied between the value of a condition field and the condition value To decide whether the condition is satisfied.Specifies condition value field.String[]Specifies condition value string.Specifies a field which holds the display name of condition value.booleanDecides whether validation check is executed when the value ofconditionFieldis not equal to the specified value.Class<?>[]Returns groups.Returns message ID.Class<? extends jakarta.validation.Payload>[]Returns payload.
-
Element Details
-
propertyPath
String[] propertyPathValidated field.Its name is
propertyPath, notfieldbecause basically you set field names (like 'name'), but you can also set a field in a bean (like 'dept.name').- Returns:
- propertyPath
-
conditionPropertyPath
String conditionPropertyPathConditional field. Validation check is executed only when the value of this field is equal to the value whichfieldWhichHoldsConditionalValueholds.Its name is
conditionPropertyPath, notconditionFieldbecause 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 conditionPatternSpecifies 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 conditionOperatorSpecifies 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[] conditionValueStringSpecifies condition value string.This is used when
HowToDetermineConditionIsValidis eitherstringValueOfConditionFieldIsEqualToorstringValueOfConditionFieldIsNotEqualTo. Otherwise it must be unset.When
stringValueOfConditionFieldIsEqualTois selected, a condition is considered to be satisfied if one of the values of this field is equal to the value of conditionField.
WhenstringValueOfConditionFieldIsNotEqualTois 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
stringValueOfConditionFieldIsEqualToandstringValueOfConditionFieldIsNotEqualToonly when the datatype of conditionField is string. Otherwise you need to choose other choice.- Returns:
- an array of string values
- Default:
{"[null]"}
-
conditionValuePropertyPath
String conditionValuePropertyPathSpecifies condition value field.This is used when
valueOfPropertyPathisvalueOfPropertyPath. Otherwise it must be unset.The datatype of the field specifies
conditionValueFieldcan be an array.
WhenConditionOperator.equalTois selected, a condition is considered to be satisfied if one of the values of the fieldconditionValueFieldspecifies is equal to the value of conditionField.
WhenConditionOperator.notEqualTois selected, a condition is considered to be satisfied if all of the values of the fieldconditionValueFieldspecifies is NOT equal to the value of conditionField.- Returns:
- an array of string values
- Default:
"[null]"
-
displayStringPropertyPathOfConditionValuePropertyPath
String displayStringPropertyPathOfConditionValuePropertyPathSpecifies 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 emptyWhenConditionNotSatisfiedDecides whether validation check is executed when the value ofconditionFieldis not equal to the specified value.- Returns:
- boolean
- Default:
false
-
message
String messageReturns message ID.- Returns:
- message ID
- Default:
"{jp.ecuacion.lib.validation.constraints.ConditionalNotEmpty.message}"
-
groups
-
payload
-