|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.validator.internal.metadata.core.ConstraintHelper
public class ConstraintHelper
Keeps track of builtin constraints and their validator implementations, as well as already resolved validator definitions.
| Field Summary | |
|---|---|
static String |
GROUPS
|
static String |
MESSAGE
|
static String |
PAYLOAD
|
static String |
VALIDATION_APPLIES_TO
|
| Constructor Summary | |
|---|---|
ConstraintHelper()
|
|
| Method Summary | ||
|---|---|---|
|
findValidatorClasses(Class<A> annotationType,
ValidationTarget validationTarget)
Returns those validator classes for the given constraint annotation matching the given target. |
|
|
getAllValidatorClasses(Class<A> annotationType)
Returns the constraint validator classes for the given constraint annotation type, as retrieved from Constraint.validatedBy(),
internally registered validators for built-in constraints and
XML configuration.
The result is cached internally. |
|
|
getMultiValueConstraints(A annotation)
Checks whether a given annotation is a multi value constraint and returns the contained constraints if so. |
|
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. |
|
|
putValidatorClasses(Class<A> annotationType,
List<Class<? extends ConstraintValidator<A,?>>> definitionClasses,
boolean keepDefaultClasses)
Registers the given validator classes with the given constraint annotation type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GROUPS
public static final String PAYLOAD
public static final String MESSAGE
public static final String VALIDATION_APPLIES_TO
| Constructor Detail |
|---|
public ConstraintHelper()
| Method Detail |
|---|
public <A extends Annotation> List<Class<? extends ConstraintValidator<A,?>>> getAllValidatorClasses(Class<A> annotationType)
Constraint.validatedBy(),
annotationType - The constraint annotation type.
public <A extends Annotation> List<Class<? extends ConstraintValidator<A,?>>> findValidatorClasses(Class<A> annotationType,
ValidationTarget validationTarget)
annotationType - The annotation of interest.validationTarget - The target, either annotated element or parameters.
public <A extends Annotation> void putValidatorClasses(Class<A> annotationType,
List<Class<? extends ConstraintValidator<A,?>>> definitionClasses,
boolean keepDefaultClasses)
annotationType - The constraint annotation typedefinitionClasses - The validators to registerkeepDefaultClasses - Whether any default validators should be kept or notpublic 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> getMultiValueConstraints(A annotation)
annotation - the annotation to check.
annotation is not a multi constraint
annotation.public boolean isConstraintAnnotation(Class<? extends Annotation> annotationType)
Constraint
annotationType - The annotation type to test.
true if the annotation fulfills the above conditions, false otherwise.public boolean isConstraintComposition(Class<? extends Annotation> annotationType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||