|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.tzavellas.validation.ValidationResult
public class ValidationResult
The result of a validation.
BeanValidator
Constructor Summary | |
---|---|
ValidationResult()
|
Method Summary | |
---|---|
void |
addError(ValidationError error)
Add a validation. |
Map<String,String> |
getErrorMessages(Locale locale)
Get a map of [field, error-message] entries for this result, if this result has no errors an empty map is returned. |
Collection<ValidationError> |
getErrors()
Get the collection of validation errors for this ValidationResult . |
boolean |
hasErrors()
Returns true if this result contains errors. |
boolean |
isValid()
Returns true if this result does not contain errors. |
void |
setMessageResolver(MessageResolver messageResolver)
Set the MessageResolver to be used for the messages of
this ValidationResult . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidationResult()
Method Detail |
---|
public void setMessageResolver(MessageResolver messageResolver)
MessageResolver
to be used for the messages of
this ValidationResult
.
The default MessageResolver
always returns the default message
of the validation error, ignoring the error's code and the specified locale.
MessageResolver
,
ValidationError
public void addError(ValidationError error)
error
- the error to addpublic Collection<ValidationError> getErrors()
ValidationResult
.
public Map<String,String> getErrorMessages(Locale locale)
locale
- the locale to use for resolving the messages. May be null, see
MessageResolver
for more info.public boolean isValid()
public boolean hasErrors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |