Package org.apache.commons.validator
Class ValidatorResults
- java.lang.Object
-
- org.apache.commons.validator.ValidatorResults
-
- All Implemented Interfaces:
java.io.Serializable
public class ValidatorResults extends java.lang.Object implements java.io.SerializableThis contains the results of a set of validation rules processed on a JavaBean.- Version:
- $Revision: 1652498 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,ValidatorResult>hResultsMap of validation results.private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ValidatorResults()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Field field, java.lang.String validatorName, boolean result)Add a the result of a validator action.voidadd(Field field, java.lang.String validatorName, boolean result, java.lang.Object value)Add a the result of a validator action.voidclear()Clear all results recorded by this object.java.util.Set<java.lang.String>getPropertyNames()Return the set of property names for which at least one message has been recorded.java.util.Map<java.lang.String,java.lang.Object>getResultValueMap()Get aMapof anyObjects returned from validation routines.ValidatorResultgetValidatorResult(java.lang.String key)Gets theValidatorResultassociated with the key passed in.booleanisEmpty()Returntrueif there are no messages recorded in this collection, orfalseotherwise.voidmerge(ValidatorResults results)Merge another ValidatorResults into mine.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
hResults
protected java.util.Map<java.lang.String,ValidatorResult> hResults
Map of validation results.
-
-
Method Detail
-
merge
public void merge(ValidatorResults results)
Merge another ValidatorResults into mine.- Parameters:
results- ValidatorResults to merge.
-
add
public void add(Field field, java.lang.String validatorName, boolean result)
Add a the result of a validator action.- Parameters:
field- The field validated.validatorName- The name of the validator.result- The result of the validation.
-
add
public void add(Field field, java.lang.String validatorName, boolean result, java.lang.Object value)
Add a the result of a validator action.- Parameters:
field- The field validated.validatorName- The name of the validator.result- The result of the validation.value- The value returned by the validator.
-
clear
public void clear()
Clear all results recorded by this object.
-
isEmpty
public boolean isEmpty()
Returntrueif there are no messages recorded in this collection, orfalseotherwise.- Returns:
- Whether these results are empty.
-
getValidatorResult
public ValidatorResult getValidatorResult(java.lang.String key)
Gets theValidatorResultassociated with the key passed in. The key theValidatorResultis stored under is theField's getKey method.- Parameters:
key- The key generated fromField(this is often just the field name).- Returns:
- The result of a specified key.
-
getPropertyNames
public java.util.Set<java.lang.String> getPropertyNames()
Return the set of property names for which at least one message has been recorded.- Returns:
- An unmodifiable Set of the property names.
-
getResultValueMap
public java.util.Map<java.lang.String,java.lang.Object> getResultValueMap()
Get aMapof anyObjects returned from validation routines.- Returns:
- Map of objections returned by validators.
-
-