org.apache.commons.validator

Class ValidatorResults

public class ValidatorResults extends Object implements Serializable

This contains the results of a set of validation rules processed on a JavaBean.
Field Summary
protected MaphResults
Map of validation results.
Method Summary
voidadd(Field field, String validatorName, boolean result)
Add a the result of a validator action.
voidadd(Field field, String validatorName, boolean result, Object value)
Add a the result of a validator action.
voidclear()
Clear all results recorded by this object.
booleanempty()
Return true if there are no messages recorded in this collection, or false otherwise.
Iteratorget()
Return the set of all recorded messages, without distinction by which property the messages are associated with.
SetgetPropertyNames()
Return the set of property names for which at least one message has been recorded.
MapgetResultValueMap()
Get a Map of any Objects returned from validation routines.
ValidatorResultgetValidatorResult(String key)
Gets the ValidatorResult associated with the key passed in.
booleanisEmpty()
Return true if there are no messages recorded in this collection, or false otherwise.
voidmerge(ValidatorResults results)
Merge another ValidatorResults into mine.
Iteratorproperties()
Return the set of property names for which at least one message has been recorded.

Field Detail

hResults

protected Map hResults
Map of validation results.

Method Detail

add

public void add(Field field, String validatorName, boolean result)
Add a the result of a validator action.

add

public void add(Field field, String validatorName, boolean result, Object value)
Add a the result of a validator action.

clear

public void clear()
Clear all results recorded by this object.

empty

public boolean empty()

Deprecated: Use isEmpty() instead.

Return true if there are no messages recorded in this collection, or false otherwise.

get

public Iterator get()

Deprecated: Use getPropertyNames() instead.

Return the set of all recorded messages, without distinction by which property the messages are associated with. If there are no messages recorded, an empty enumeration is returned.

getPropertyNames

public Set 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 Map getResultValueMap()
Get a Map of any Objects returned from validation routines.

getValidatorResult

public ValidatorResult getValidatorResult(String key)
Gets the ValidatorResult associated with the key passed in. The key the ValidatorResult is stored under is the Field's getKey method.

Parameters: key The key generated from Field (this is often just the field name).

isEmpty

public boolean isEmpty()
Return true if there are no messages recorded in this collection, or false otherwise.

merge

public void merge(ValidatorResults results)
Merge another ValidatorResults into mine.

properties

public Iterator properties()

Deprecated: Use getPropertyNames() instead.

Return the set of property names for which at least one message has been recorded. If there are no messages, an empty Iterator is returned. If you have recorded global messages, the String value of ActionMessages.GLOBAL_MESSAGE will be one of the returned property names.
Copyright (c) 2001-2004 Apache Software Foundation