|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.exolab.castor.xml.Validator org.exolab.castor.xml.FieldValidator
Handles field validation
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(java.lang.Object object,
ValidationContext context)
Validates the given Object |
Methods inherited from class org.exolab.castor.xml.Validator |
validate |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FieldValidator()
public FieldValidator(TypeValidator validator)
validator
- the TypeValidator to delegate validation toMethod Detail |
public int getMinOccurs()
public int getMaxOccurs()
public TypeValidator getTypeValidator()
public boolean hasTypeValidator()
public void setMinOccurs(int minOccurs)
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)public void setMaxOccurs(int maxOccurs)
maxOccurs
- the maximum number of times an object
may occur. A negative value denotes no upper bound.public void setDescriptor(XMLFieldDescriptor descriptor)
descriptor
- the field descriptor for the field to validatepublic void setValidator(TypeValidator validator)
public void validate(java.lang.Object object, ValidationContext context) throws ValidationException
validate
in interface ClassValidator
validate
in class Validator
object
- the Object that contains the field to validatecontext
- the ValidationContext
ValidationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |