Class BeanValidator
java.lang.Object
net.sourceforge.jbizmo.commons.validation.BeanValidator
This class provides validation services within the constraint framework
Copyright 2010 (C) by Martin Ganserer
- Version:
- 1.0.0
- Author:
- Martin Ganserer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ConstraintViolation>checkConstraints(Object value, Set<Annotation> annotations) Check the constraintsvoidvalidate()Validate the objectvalidateProperty(ConstrainedClass constrainedClass, String propertyName, Object value) Checks if the value is valid
-
Constructor Details
-
BeanValidator
Constructor- Parameters:
validationTarget-- Throws:
IllegalArgumentException- if the validationTarget is null
-
-
Method Details
-
getConstrainedClass
- Returns:
- the
ConstrainedClassthat provides access to the property constraints for this class
-
validate
public void validate()Validate the object- Throws:
PropertyConstraintViolationException- if the validation of a property value has failed
-
validateProperty
public List<ConstraintViolation> validateProperty(ConstrainedClass constrainedClass, String propertyName, Object value) throws IntrospectionException Checks if the value is valid- Parameters:
constrainedClass-propertyName-value-- Returns:
- a list of constraint violations
- Throws:
IntrospectionException- if there are problems accessing the property
-
checkConstraints
Check the constraints- Parameters:
value- the value to be checkedannotations-- Returns:
- a list of constraint violations
-