V
- The type of value to be validatedpublic interface Validation<V>
Validation
is
an abstract component that allows somehow validate values and may generate
ViolationException
if validation fails.
Validation
implementations should be immutable.
ValidationContext
Modifier and Type | Method and Description |
---|---|
boolean |
appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Determines if error message template returned by the method
getMessageTemplate(ValidationContext) needs to be rendered and
appends arguments to be substituted into the error message template. |
String |
getMessageTemplate(ValidationContext<?> context)
Returns localized error message template.
|
Class<?> |
getType()
Returns the type of value to be validated.
|
Class<?> getType()
String getMessageTemplate(ValidationContext<?> context)
Note that this method may return null
.
context
- Validation context.boolean appendMessageArguments(ValidationContext<?> context, Map<String,Object> arguments)
getMessageTemplate(ValidationContext)
needs to be rendered and
appends arguments to be substituted into the error message template.context
- Validation context.arguments
- Arguments to be substituted into the error message
template.true
if error message template needs to be rendered;
false
otherwise.Copyright © 2011–2020 FoxLabs. All rights reserved.