@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy=io.xlate.validation.internal.constraintvalidators.DateTimeValidator.class)
@Repeatable(List.class)
public @interface DateTime
The annotated element value must contain characters valid for the given
patterns. The value must be able to be parsed.
Supported types are:
CharSequence
null elements are considered valid.
- Author:
- Michael Edgar
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines severalDateTimeannotations on the same element.static enum -
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
message
String message -
patterns
String[] patternsValid date patterns to which the annotated element must conform. Legal values for the patterns depends on the value ofparserType()being used.- Returns:
- patterns the valid date patterns to which the annotated element must conform
-
-
-
groups
Class<?>[] groups- Default:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payload- Default:
- {}
-
lenient
boolean lenient- Returns:
- lenient whether the parsing mode should be lenient. Ignored
unless
parserType()isDateTime.ParserType.JAVA_TEXT.
- Default:
- false
-
parserType
DateTime.ParserType parserType- Returns:
- formatter type to use for parsing date/time strings during validation
- Since:
- 1.2
- Default:
- JAVA_TEXT
-
resolverStyle
ResolverStyle resolverStyle- Returns:
- the resolver style to use during parsing. Ignored unless
parserType()isDateTime.ParserType.JAVA_TIME. - Since:
- 1.2
- See Also:
- Default:
- SMART
-