public interface ValidationContext
Context used to lookup validation adapters and create validation requests.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Request to create a Validation Adapter.static interface
Factory for creating a ValidationAdapter for a given type.static interface
Factory for creating an Annotation Adapter for a given annotation.static interface
Represents a message object used in error message interpolation. -
Method Summary
Modifier and TypeMethodDescription<T> ValidationAdapter
<T> Return the constraint adapter for the given annotation with attributes.<T> ValidationAdapter
<T> adapter
(Class<? extends Annotation> cls, Set<Class<?>> groups, String message, Map<String, Object> attributes) Return the constraint adapter for the given annotation with attributes.<T> ValidationAdapter
<T> Return the adapter for the given type.<T> ValidationAdapter
<T> Return the adapter for the given type.Create a message object using the given string.Create a message object using the annotation attribute "message".<T> ValidationAdapter
<T> noop()
Return a no-op adapter.Create a validation request with the specified locale and groups.
-
Method Details
-
adapter
Return the adapter for the given type.- Type Parameters:
T
- The type this adapter validates- Parameters:
cls
- The class for which the adapter is requested- Returns:
- The validation adapter for the given type
-
adapter
Return the adapter for the given type.- Type Parameters:
T
- The type this adapter validates- Parameters:
type
- The type for which the adapter is requested- Returns:
- The validation adapter for the given type
-
adapter
Return the constraint adapter for the given annotation with attributes.- Type Parameters:
T
- The type this adapter validates- Parameters:
cls
- The annotation classattributes
- The attributes associated with the annotation- Returns:
- The validation adapter for the given annotation with attributes
-
adapter
<T> ValidationAdapter<T> adapter(Class<? extends Annotation> cls, Set<Class<?>> groups, String message, Map<String, Object> attributes) Return the constraint adapter for the given annotation with attributes. Used for adapters that combine multiple annotation adapters.- Type Parameters:
T
- The type this adapter validates- Parameters:
cls
- The class representing the annotation typegroups
- The validation groups associated with the annotationmessage
- The error message associated with the annotationattributes
- The attributes associated with the annotation- Returns:
- The validation adapter for the given annotation with attributes
-
noop
Return a no-op adapter.- Type Parameters:
T
- The type this adapter validates- Returns:
- The no-op validation adapter
-
message
Create a message object using the annotation attribute "message".- Parameters:
attributes
- The attributes associated with the annotation- Returns:
- The message object
-
message
Create a message object using the given string.- Parameters:
message
- The error messageattributes
- The attributes associated with the annotation- Returns:
- The message object created using the given string and annotation attributes
-
request
Create a validation request with the specified locale and groups.- Parameters:
locale
- The locale for the validation requestgroups
- The validation groups for the request- Returns:
- The validation request with the specified locale and groups
-