Annotation Type SizeWithoutSeparators
@Documented
@Constraint(validatedBy=SizeWithoutSeparatorsValidator.class)
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
@Retention(RUNTIME)
public @interface SizeWithoutSeparators
The annotated element size must be between the specified boundaries (included).
Supported types are Strings, other Objects are transfered to Strings,
With the following options separator characters can be removed before size is checked:
Supported types are Strings, other Objects are transfered to Strings,
null elements
are considered valid.With the following options separator characters can be removed before size is checked:
- ignoreWhiteSpaces (true/false, default false)
- ignoreMinus (true/false, default false)
- ignoreSlashes (true/false, default false)
- Author:
- Manfred Tremmel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines severalSizeWithoutSeparatorsannotations on the same element. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]groups to use.booleantrue if minus should be ignored.booleantrue if slashes should be ignored.booleantrue if white spaces should be ignored.intsize the element must be lower or equal to.localized message.intsize the element must be higher or equal to.Class<? extends jakarta.validation.Payload>[]payload whatever.
-
Element Details
-
message
String messagelocalized message.- Returns:
- localized validation message
- Default:
- "{jakarta.validation.constraints.Size.message}"
-
groups
Class<?>[] groupsgroups to use.- Returns:
- array of validation groups
- Default:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payloadpayload whatever.- Returns:
- payload class
- Default:
- {}
-
min
int minsize the element must be higher or equal to.- Returns:
- min value
- Default:
- 0
-
max
int maxsize the element must be lower or equal to.- Returns:
- max value
- Default:
- 2147483647
-
ignoreWhiteSpaces
boolean ignoreWhiteSpacestrue if white spaces should be ignored.- Returns:
- true if white spaces should be ignored
- Default:
- false
-
ignoreMinus
boolean ignoreMinustrue if minus should be ignored.- Returns:
- true if minus signs shoulc be ignored
- Default:
- false
-
ignoreSlashes
boolean ignoreSlashestrue if slashes should be ignored.- Returns:
- true if slashes should be ignored
- Default:
- false
-