| nl.knowlogy.validation.ClassValidator
All known Subclasses: nl.knowlogy.validation.ClassValidatorImpl,
ClassValidator | public interface ClassValidator (Code) | |
A ClassValidator validates objects of specific classes and can be registered
with a ValidationEngine. The ValidationEngine uses these classvalidators
for validating objects, by calling the validate method.
ClassValidatorImpl forms the baseclass for objects which are implementing the
ClassValidator interface. These validation classes can be generated with XDoclet tags or
annotations in classes which they are validating.
See Also: PropertyValidation See Also: ValidationEngine author: Robert Hofstra, Knowlogy |
Method Summary | |
void | add(PropertyValidation propertyValidation) Adds a PropertyValidation to the classValidator. | void | addPropertyToGroups(String groupNames, String propertyName) Add a property identified to groups. | Class | getClazz() Returns clazz that can be validated by this validator. | void | validate(Object toValidate) Validates the object, if an error is signaled a Validation exception is thrown. | void | validate(Object toValidate, Messages messages) Validates the whole object. | void | validateGroup(Object toValidate, String groupName, Messages messages) Validates only the properties, which are contained in the group. | void | validateProperties(Object toValidate, List propertyNames, Messages messages) Validates only the properties, supplied in de propertyNames list, of
the object toValidate. | void | validatePropertyValue(String propertyName, Object value, Messages messages) Validates the value of a property identified with name. |
add | void add(PropertyValidation propertyValidation)(Code) | | Adds a PropertyValidation to the classValidator. This can be used to
add programmatically add additional validations to generated classvalidators.
Parameters: propertyValidation - See Also: PropertyValidation |
addPropertyToGroups | void addPropertyToGroups(String groupNames, String propertyName)(Code) | | Add a property identified to groups.
Parameters: groupNames - string with names of groups seperated by ",". Parameters: propertyName - name of the property |
getClazz | Class getClazz()(Code) | | Returns clazz that can be validated by this validator.
Subclasses of this class can also be validated by this class.
class |
validate | void validate(Object toValidate)(Code) | | Validates the object, if an error is signaled a Validation exception is thrown.
Parameters: toValidate - object to validate |
validate | void validate(Object toValidate, Messages messages)(Code) | | Validates the whole object. In case of validation errors, validation messages are
added to the messages.
Parameters: toValidate - object to validate Parameters: messages - container to which validate messages are added. |
validateGroup | void validateGroup(Object toValidate, String groupName, Messages messages)(Code) | | Validates only the properties, which are contained in the group. This group is
identified by groupname. In case of validation errors, validation messages are
added to the messages.
Parameters: toValidate - object which group is validated. Parameters: groupName - name of the group. Parameters: messages - container to which validate messages are added. |
validateProperties | void validateProperties(Object toValidate, List propertyNames, Messages messages)(Code) | | Validates only the properties, supplied in de propertyNames list, of
the object toValidate. In case of validation errors, validation messages are
added to the messages.
Parameters: toValidate - object which properties are validated Parameters: propertyNames - List of names (String) of the properties which are validated Parameters: messages - container to which validate messages are added. |
validatePropertyValue | void validatePropertyValue(String propertyName, Object value, Messages messages)(Code) | | Validates the value of a property identified with name. This to validate a value
without setting the value of the javabean property. Validation messages are
provided without a object which has the value.
Parameters: propertyName - name of the property Parameters: value - value Parameters: messages - a messages container to provide messages. |
|
|