Annotation Type NotEmptyIfOtherIsNotEmpty
-
@Documented @Constraint(validatedBy=NotEmptyIfOtherIsNotEmptyValidator.class) @Target({TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) public @interface NotEmptyIfOtherIsNotEmpty
The annotated bean must contain at least two properties:- a field that has to be checked (option
field) - a field which entry is compared (option
fieldCompare)
fieldCompareis not empty (null or ""),fieldmust also 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.StringfieldComparefield name to compare.
-
-
-
Element Detail
-
field
String field
field name to check.- Returns:
- field/path contains value to check
-
-
-
fieldCompare
String fieldCompare
field name to compare.- Returns:
- field/path containing compare value
-
-
-
message
String message
localized message.- Returns:
- localized validation message
- Default:
- "{de.knightsoftnet.validators.shared.NotEmptyIfOtherIsNotEmpty.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:
- {}
-
-