|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAnnotationConstraintValidator
public class AnnotationConstraintValidator
This class offers methods for validating values assigned to a control property.
The validation process will ensure
1. The value is appropriate for the property's property type
2. The value satisfies the constraints defined on the property type
3. The value satisfies the constraints defined on the property set that the property is defined in.
Refer to AnnotationMemberTypes
and
AnnotationConstraints
for more
information on property constraints.
Constructor Summary | |
---|---|
AnnotationConstraintValidator()
|
Method Summary | |
---|---|
static Date |
parseDate(String format,
String value)
Parse a date value into the specified format. |
protected static void |
validate(Annotation[] annotations,
Object value)
|
static void |
validate(PropertyKey key,
Object value)
This method ensures that any control property value assignment satisfies all property constraints. |
static void |
validateMembership(Annotation propertySet)
This method ensures the membership constraints defined on a property set is satisfied. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationConstraintValidator()
Method Detail |
---|
public static void validate(PropertyKey key, Object value) throws IllegalArgumentException
key
- The property that the specified key is assigned tovalue
- The value assigned to the specified property key
IllegalArgumentException
- when the value assigned to the specified property key does
not satisfy a property constraint.public static void validateMembership(Annotation propertySet)
propertySet
- the property set to validateprotected static void validate(Annotation[] annotations, Object value) throws IllegalArgumentException
IllegalArgumentException
public static Date parseDate(String format, String value) throws ParseException
format
- Format string for the date.value
- A String containing the date value to parse.
ParseException
- If the value is not a valid date.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |