public class ConstraintHelper extends Object
Constructor and Description |
---|
ConstraintHelper() |
Modifier and Type | Method and Description |
---|---|
<A extends Annotation> |
addConstraintValidatorDefinition(Class<A> annotationClass,
List<Class<? extends ConstraintValidator<? extends Annotation,?>>> definitionClasses) |
boolean |
containsConstraintValidatorDefinition(Class<? extends Annotation> annotationClass) |
List<Class<? extends ConstraintValidator<? extends Annotation,?>>> |
getBuiltInConstraints(Class<? extends Annotation> annotationClass) |
<A extends Annotation> |
getConstraintsFromMultiValueConstraint(A multiValueConstraint)
Returns the constraints which are part of the given multi-value constraint.
|
<T extends Annotation> |
getConstraintValidatorDefinition(Class<T> annotationClass) |
boolean |
isBuiltinConstraint(Class<? extends Annotation> annotationType) |
boolean |
isConstraintAnnotation(Class<? extends Annotation> annotationType)
Checks whether the specified annotation is a valid constraint annotation.
|
boolean |
isConstraintComposition(Class<? extends Annotation> annotationType) |
boolean |
isMultiValueConstraint(Class<? extends Annotation> annotationType)
Checks whether a given annotation is a multi value constraint or not.
|
public List<Class<? extends ConstraintValidator<? extends Annotation,?>>> getBuiltInConstraints(Class<? extends Annotation> annotationClass)
public boolean isBuiltinConstraint(Class<? extends Annotation> annotationType)
public boolean isMultiValueConstraint(Class<? extends Annotation> annotationType)
annotationType
- the annotation type to check.true
if the specified annotation is a multi value constraints, false
otherwise.public <A extends Annotation> List<Annotation> getConstraintsFromMultiValueConstraint(A multiValueConstraint)
Invoke isMultiValueConstraint(Class)
prior to calling this method to check whether a given constraint
actually is a multi-value constraint.
A
- the type of the annotationmultiValueConstraint
- the multi-value constraint annotation from which to retrieve the contained constraintsnull
.public boolean isConstraintAnnotation(Class<? extends Annotation> annotationType)
ConstraintValidator
implementation.annotationType
- The annotation type to test.true
if the annotation fulfills the above condtions, false
otherwise.public <T extends Annotation> List<Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorDefinition(Class<T> annotationClass)
public <A extends Annotation> void addConstraintValidatorDefinition(Class<A> annotationClass, List<Class<? extends ConstraintValidator<? extends Annotation,?>>> definitionClasses)
public boolean containsConstraintValidatorDefinition(Class<? extends Annotation> annotationClass)
public boolean isConstraintComposition(Class<? extends Annotation> annotationType)
Copyright © 2007-2014 Red Hat Middleware, LLC. All Rights Reserved