Package org.apache.commons.validator
Class ValidatorResult
- java.lang.Object
-
- org.apache.commons.validator.ValidatorResult
-
- All Implemented Interfaces:
java.io.Serializable
public class ValidatorResult extends java.lang.Object implements java.io.Serializable
This contains the results of a set of validation rules processed on a JavaBean.- Version:
- $Revision: 1652498 $
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ValidatorResult.ResultStatus
Contains the status of the validation.
-
Field Summary
Fields Modifier and Type Field Description protected Field
field
Field
being validated.protected java.util.Map<java.lang.String,ValidatorResult.ResultStatus>
hAction
Map of results.private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ValidatorResult(Field field)
Constructs aValidatorResult
with the associated field being validated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(java.lang.String validatorName, boolean result)
Add the result of a validator action.void
add(java.lang.String validatorName, boolean result, java.lang.Object value)
Add the result of a validator action.boolean
containsAction(java.lang.String validatorName)
Indicate whether a specified validator is in the Result.java.util.Map<java.lang.String,ValidatorResult.ResultStatus>
getActionMap()
Deprecated.Use getActions() to return the set of actions the isValid(name) and getResult(name) methods to determine the contents of ResultStatus.java.util.Iterator<java.lang.String>
getActions()
Return an Iterator of the action names contained in this Result.Field
getField()
Returns the Field that was validated.java.lang.Object
getResult(java.lang.String validatorName)
Return the result of a validation.boolean
isValid(java.lang.String validatorName)
Indicate whether a specified validation passed.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
hAction
protected java.util.Map<java.lang.String,ValidatorResult.ResultStatus> hAction
Map of results. The key is the name of theValidatorAction
and the value is whether or not this field passed or not.
-
field
protected Field field
Field
being validated. TODO This variable is not used. Need to investigate removing it.
-
-
Constructor Detail
-
ValidatorResult
public ValidatorResult(Field field)
Constructs aValidatorResult
with the associated field being validated.- Parameters:
field
- Field that was validated.
-
-
Method Detail
-
add
public void add(java.lang.String validatorName, boolean result)
Add the result of a validator action.- Parameters:
validatorName
- Name of the validator.result
- Whether the validation passed or failed.
-
add
public void add(java.lang.String validatorName, boolean result, java.lang.Object value)
Add the result of a validator action.- Parameters:
validatorName
- Name of the validator.result
- Whether the validation passed or failed.value
- Value returned by the validator.
-
containsAction
public boolean containsAction(java.lang.String validatorName)
Indicate whether a specified validator is in the Result.- Parameters:
validatorName
- Name of the validator.- Returns:
- true if the validator is in the result.
-
isValid
public boolean isValid(java.lang.String validatorName)
Indicate whether a specified validation passed.- Parameters:
validatorName
- Name of the validator.- Returns:
- true if the validation passed.
-
getResult
public java.lang.Object getResult(java.lang.String validatorName)
Return the result of a validation.- Parameters:
validatorName
- Name of the validator.- Returns:
- The validation result.
-
getActions
public java.util.Iterator<java.lang.String> getActions()
Return an Iterator of the action names contained in this Result.- Returns:
- The set of action names.
-
getActionMap
public java.util.Map<java.lang.String,ValidatorResult.ResultStatus> getActionMap()
Deprecated.Use getActions() to return the set of actions the isValid(name) and getResult(name) methods to determine the contents of ResultStatus.Return a Map of the validator actions in this Result.- Returns:
- Map of validator actions.
-
getField
public Field getField()
Returns the Field that was validated.- Returns:
- The Field associated with this result.
-
-