|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.bval.ValidationResults
public class ValidationResults
Description: Implements a contains to hold and transport validation results
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.bval.model.ValidationListener |
---|
ValidationListener.Error |
Constructor Summary | |
---|---|
ValidationResults()
|
Method Summary | ||
---|---|---|
void |
addError(String reason,
Object bean,
String propertyName)
Old API to add an error to the validation results when no context is available. |
|
|
addError(String reason,
ValidationContext<T> context)
API to add an error to the validation results. |
|
|
addError(ValidationListener.Error error,
ValidationContext<T> context)
API to add an error to the validation results. |
|
protected void |
addToOwnerBucket(ValidationListener.Error error)
Add an Error to the property-keyed map of Errors maintained for this Error's owner. |
|
protected void |
addToReasonBucket(ValidationListener.Error error)
Add an Error to the set of Errors shared by a particular "reason." |
|
protected ValidationListener.Error |
createError(String reason,
Object owner,
String propertyName)
Create an Error object. |
|
Map<Object,Map<String,List<ValidationListener.Error>>> |
getErrorsByOwner()
Get the map of Errors by owner; key = owner, value = map with: key = propertyName, value = list of errors for this owner.propertyName |
|
Map<String,List<ValidationListener.Error>> |
getErrorsByReason()
Get the map of Errors by reason; key = reason, value = list of errors for this reason |
|
boolean |
hasError(Object bean,
String propertyName)
Learn whether bean has any errors keyed to property propertyName . |
|
boolean |
hasErrorForReason(String reason)
Learn whether there is an Error keyed to a specified reason description. |
|
protected void |
initialize()
initialize the error-buckets now when needed and not on instance creation to save memory garbage. |
|
boolean |
isEmpty()
Learn whether these results are empty/error-free. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ValidationResults()
Method Detail |
---|
public <T extends ValidationListener> void addError(String reason, ValidationContext<T> context)
addError
in interface ValidationListener
reason
- - Features from Features.Property
or custom reason of validation errorcontext
- - context information (bean, propertyName, value, ...)public <T extends ValidationListener> void addError(ValidationListener.Error error, ValidationContext<T> context)
addError
in interface ValidationListener
error
- - holding the description of reason and object to describe
the validation errorcontext
- - null or the context to provide additional informationpublic void addError(String reason, Object bean, String propertyName)
reason
- - Features from Features.Property
or custom validation reasonbean
- - (optional) owner bean or nullpropertyName
- - (optional) propertyName where valiation error occurred or nullprotected ValidationListener.Error createError(String reason, Object owner, String propertyName)
reason
- owner
- propertyName
-
Error
protected void initialize()
protected void addToReasonBucket(ValidationListener.Error error)
error
- Error#getReason()}
protected void addToOwnerBucket(ValidationListener.Error error)
error
- Error#getOwner()}
public Map<String,List<ValidationListener.Error>> getErrorsByReason()
public Map<Object,Map<String,List<ValidationListener.Error>>> getErrorsByOwner()
public boolean isEmpty()
public boolean hasErrorForReason(String reason)
reason
-
Error#getReason()}
public boolean hasError(Object bean, String propertyName)
bean
has any errors keyed to property propertyName
.
bean
- propertyName
- - may be null: any property is checked
OR the name of the property to check
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |