org.exolab.castor.xml
public class FieldValidator extends Validator
Version: $Revision: 1.10 $ $Date: 2004/10/09 04:58:55 $
Constructor Summary | |
---|---|
FieldValidator()
Creates a default FieldValidator
| |
FieldValidator(TypeValidator validator)
Creates a new FieldValidator using the given TypeValidator |
Method Summary | |
---|---|
int | getMaxOccurs()
Returns the maximum number of occurances for a given object.
|
int | getMinOccurs()
Returns the mimimum number of occurances for a given object.
|
TypeValidator | getTypeValidator()
Returns true if a TypeValidator has been set
|
boolean | hasTypeValidator()
Returns true if a TypeValidator has been set
|
void | setDescriptor(XMLFieldDescriptor descriptor)
Sets the field descriptor to use for obtaining information
about the field to validate, such as the field name, the field
handler, etc. |
void | setMaxOccurs(int maxOccurs)
Sets the maximum number of occurances for a given object
|
void | setMinOccurs(int minOccurs)
Sets the mimimum number of occurances for a given object
|
void | setValidator(TypeValidator validator) |
void | validate(Object object, ValidationContext context)
Validates the given Object
|
Parameters: validator the TypeValidator to delegate validation to
UNKNOWN: the maximum number of occurances for a given object. A negative value denotes no upper bound.
UNKNOWN: the mimimum number of occurances for a given object. A zero value denotes no lower bound (ie. the object is optional)
Returns: true if a TypeValidator has been set
Returns: true if a TypeValidator has been set
Parameters: descriptor the field descriptor for the field to validate
Parameters: maxOccurs the maximum number of times an object may occur. A negative value denotes no upper bound.
Parameters: minOccurs the minimum number of times an object must occur in order to be valid. A zero, or negative value denotes no lower bound (ie. the object is optional)
Parameters: object the Object that contains the field to validate context the ValidationContext