Annotation Interface NotEmptyWhen
propertyPath is not empty only when condition is satisfied.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines severalNotEmptyWhenannotations on the same element. -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionIs a field, whose value determines whether the validation is executed or not.Specifies a value used for determination whether validation is executed or not.String[]Is a 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.Specifies condition regular expression.String[]Specifies condition value string.Specifies the the display string of condition value.booleanDecides whether validation check is executed when the condition is not satisfied.Class<?>[]Returns groups.Returns message ID.Class<? extends jakarta.validation.Payload>[]Returns payload.
-
Element Details
-
propertyPath
String[] propertyPathIs a validated 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').The datatype is an array in order to validate multiple values at once.
- Returns:
- propertyPath
-
conditionPropertyPath
String conditionPropertyPathIs a field, whose value determines whether the validation is executed or not.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:
- conditionPropertyPath
-
conditionValue
ConditionValue conditionValueSpecifies a value used for determination whether validation is executed or not.ConditionValue has several types of values.
Values which designate fixed values (such as EMPTY, TRUE, FALSE) means the same as empty (null for all datatypes and "" for String) and boolean true / false.
Values such as STRING, PATTERN and VALUE_OF_PROPERTY_PATH does not directly express fixed values. So they need additional parameters to specify a variety of values.- 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:
EQUAL_TO
-
conditionValueString
String[] conditionValueStringSpecifies condition value string.This is used when
ConditionValueisSTRING. Otherwise it must be unset.The condition is satisfied when
ConditionOperatorisEQUAL_TOand one of the values of this field is equal to the value of conditionPropertyPath.
Otherwise whenConditionOperatorisNOT_EQUAL_TO.You can use
ConditionValue == STRINGonly when the datatype of conditionField is string. Otherwise you need to choose other choice.- Returns:
- an array of string values
- Default:
{"[null]"}
-
conditionValueRegexp
String conditionValueRegexpSpecifies condition regular expression.This is used when
ConditionValueisPATTERN. Otherwise it must be unset.The condition is satisfied when
ConditionOperatorisEQUAL_TOand the value of conditionPropertyPath satisfies the regular expression.
Otherwise whenConditionOperatorisNOT_EQUAL_TO.You can use
ConditionValue == Patternonly when the datatype of conditionField is string. Otherwise you need to choose other choice.- Returns:
- regular expression
- Default:
"[null]"
-
conditionValuePropertyPath
String conditionValuePropertyPathSpecifies condition value field.This is used when
ConditionValueisVALUE_OF_PROPERTY_PATH. Otherwise it must be unset.The datatype of
conditionValuePropertyPathcan be the same as that ofconditionPropertyPath, or its array. (Collectionnot supported)The condition is satisfied when
ConditionOperatorisEQUAL_TOand the value ofconditionPropertyPathis equal to the value [one of values] ofconditionValuePropertyPath.
Otherwise whenConditionOperatorisNOT_EQUAL_TO.- Returns:
- an array of string values
- Default:
"[null]"
-
displayStringOfConditionValue
String displayStringOfConditionValueSpecifies the the display string 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 condition is not satisfied.- Returns:
- boolean
- Default:
false
-
message
String messageReturns message ID.- Returns:
- message ID
- Default:
"{jp.ecuacion.lib.validation.constraints.NotEmptyWhen.message}"
-
groups
-
payload
-