org.apache.commons.validator
Class ValidatorResult
java.lang.Object
org.apache.commons.validator.ValidatorResult
- Serializable
public class ValidatorResult
extends java.lang.Object
implements Serializable
This contains the results of a set of validation rules processed
on a JavaBean.
$Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
ValidatorResult(Field field) - Constructs a
ValidatorResult with the associated field being
validated.
|
void | add(String validatorName, boolean result) - Add the result of a validator action.
|
void | add(String validatorName, boolean result, Object value) - Add the result of a validator action.
|
boolean | containsAction(String validatorName) - Indicate whether a specified validator is in the Result.
|
Map | getActionMap() - Use getActions() to return the set of actions
the isValid(name) and getResult(name) methods
to determine the contents of ResultStatus.
|
Iterator | getActions() - Return an Iterator of the action names contained in this Result.
|
Field | getField() - Returns the Field that was validated.
|
Object | getResult(String validatorName) - Return the result of a validation.
|
boolean | isValid(String validatorName) - Indicate whether a specified validation passed.
|
field
protected Field field
Field
being validated.
TODO This variable is not used. Need to investigate removing it.
hAction
protected Map hAction
Map of results. The key is the name of the ValidatorAction
and the value is whether or not this field passed or not.
ValidatorResult
public ValidatorResult(Field field)
Constructs a ValidatorResult
with the associated field being
validated.
field
- Field that was validated.
add
public void add(String validatorName,
boolean result)
Add the result of a validator action.
validatorName
- Name of the validator.result
- Whether the validation passed or failed.
add
public void add(String validatorName,
boolean result,
Object value)
Add the result of a validator action.
validatorName
- Name of the validator.result
- Whether the validation passed or failed.value
- Value returned by the validator.
containsAction
public boolean containsAction(String validatorName)
Indicate whether a specified validator is in the Result.
validatorName
- Name of the validator.
- true if the validator is in the result.
getActionMap
public Map getActionMap()
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.
- Map of validator actions.
getActions
public Iterator getActions()
Return an Iterator of the action names contained in this Result.
getField
public Field getField()
Returns the Field that was validated.
- The Field associated with this result.
getResult
public Object getResult(String validatorName)
Return the result of a validation.
validatorName
- Name of the validator.
isValid
public boolean isValid(String validatorName)
Indicate whether a specified validation passed.
validatorName
- Name of the validator.
- true if the validation passed.
Copyright (c) 2001-2004 Apache Software Foundation