Annotation Type MultiFileSizeIf
-
@Documented @Target(TYPE) @Retention(RUNTIME) @Constraint(validatedBy=MultiFileSizeIfValidator.class) @Repeatable(List.class) public @interface MultiFileSizeIf
Class-level constraint annotation that checks enforces another constraint to a field of the class only when a condition that may depend on other fields of the class is satisfied. If the condition is satisfied, theMultiFileSizeIf
constraint is enforced on thefield()
. Otherwise, no constraint is enforced.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description MultiFileSize
constraint
String[]
dependants
String
field
-
-
-
Element Detail
-
constraint
MultiFileSize constraint
- Returns:
- Details for the
MultiFileSize
constraint to check if the condition is satisfied.
-
-
-
dependants
String[] dependants
- Returns:
- A list of properties upon which this conditional constraint depends. The values of these properties are passed to the test method in the order as specified here.
-
-
-
field
String field
- Returns:
- Field on which the
constraint()
is applied the when condition is satisfied.
-
-
-
groups
Class<?>[] groups
- Returns:
- Allows the specification of validation groups, to which this constraint belongs. When not specified, the
constraint is placed in the
Default
group.
- Default:
- {}
-
-
-
message
String message
- Returns:
- The default key for creating error messages in case the constraint is violated.
- Default:
- "{de.xima.fc.workflow.validation.constraints.MultiFileSize.message}"
-
-
-
payload
Class<? extends javax.validation.Payload>[] payload
- Returns:
- The payload that can be used by clients of the Jakarta Bean Validation API to assign custom payload objects to a constraint.
- Default:
- {}
-
-
-
target
Class<?> target
- Returns:
- The target class with the test method specified by
test()
. When setObject
.class, defaults the runtime class of the instance being validated. It is generally good practice to set this target, as it enables checking whether the test method exists without having to perform a validation.
- Default:
- java.lang.Object.class
-
-
-
test
String test
- Returns:
- Name of the test method to invoke when checking whether the
constraint()
needs to be enforced. This must be a static method of thetarget()
, taking the parameters in the same order as declared bydependants()
. Defaults totest
when empty.CapitalizedFieldName
- Default:
- ""
-
-