Annotation Type NotEmptyAlternateIfOtherHasValue
-
@Documented @Constraint(validatedBy=NotEmptyAlternateIfOtherHasValueValidator.class) @Target({TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) public @interface NotEmptyAlternateIfOtherHasValue
The annotated bean must contain at least three properties:- a field that has to be checked (option
field) - a field that has alternate to be checked (option
fieldAlternate) - a field which entry is compared against a value (option
fieldCompareandvalueCompare)
fieldComparematchesvalueCompare,fieldor alternatefieldAlternatemust not be empty (null or "").
Supported types are beans,nullelements are considered valid.- Author:
- Manfred Tremmel
- a field that has to be checked (option
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description Stringfieldfield name to check.StringfieldAlternatealternate field name to check.StringfieldComparefield name to compare.String[]valueComparevalue the compare field must have to check.
-
-
-
Element Detail
-
field
String field
field name to check.- Returns:
- field/path contains value to check
-
-
-
fieldAlternate
String fieldAlternate
alternate field name to check.- Returns:
- field/path contains alternate value to check
-
-
-
fieldCompare
String fieldCompare
field name to compare.- Returns:
- field/path contains value to compare
-
-
-
valueCompare
String[] valueCompare
value the compare field must have to check.- Returns:
- value to compare
-
-
-
message
String message
localized message.- Returns:
- localized validation message
- Default:
- "{de.knightsoftnet.validators.shared.NotEmptyAlternateIfOtherHasValue.message}"
-
-
-
groups
Class<?>[] groups
groups to use.- Returns:
- array of validation groups
- Default:
- {}
-
-
-
payload
Class<? extends javax.validation.Payload>[] payload
payload whatever.- Returns:
- payload class
- Default:
- {}
-
-