|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.validator.ap.util.ConstraintHelper
public class ConstraintHelper
Helper class that deals with all constraint-related stuff, such as determining whether a given annotation represents a constraint annotation or whether a given annotation is allowed to be declared at a given element.
Nested Class Summary | |
---|---|
static class |
ConstraintHelper.AnnotationType
The type of an annotation with respect to the BV API. |
static class |
ConstraintHelper.ConstraintCheckResult
Possible results of a constraint check as returned by checkConstraint(DeclaredType, TypeMirror) . |
Constructor Summary | |
---|---|
ConstraintHelper(Elements elementUtils,
Types typeUtils,
AnnotationApiHelper annotationApiHelper)
|
Method Summary | |
---|---|
ConstraintHelper.ConstraintCheckResult |
checkConstraint(DeclaredType constraintAnnotationType,
TypeMirror typeOfAnnotatedElement)
Checks whether the given annotation type (which must be a constraint annotation type) may be specified at elements of the specified type. |
ConstraintHelper.AnnotationType |
getAnnotationType(AnnotationMirror annotationMirror)
Returns the ConstraintHelper.AnnotationType of the given annotation. |
List<AnnotationMirror> |
getPartsOfMultiValuedConstraint(AnnotationMirror annotationMirror)
Returns a list with the constraint annotations contained in the given array-valued annotation mirror. |
boolean |
isComposedConstraint(TypeElement element)
Checks, whether the given type element represents a composed constraint or not. |
boolean |
isConstraintAnnotation(Element element)
Checks, whether the given type element represents a constraint annotation or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstraintHelper(Elements elementUtils, Types typeUtils, AnnotationApiHelper annotationApiHelper)
Method Detail |
---|
public boolean isConstraintAnnotation(Element element)
Constraint
meta-annotation (which is only allowed at annotation
declarations).
element
- The element of interest.
public ConstraintHelper.AnnotationType getAnnotationType(AnnotationMirror annotationMirror)
ConstraintHelper.AnnotationType
of the given annotation.
annotationMirror
- The annotation mirror of interest.
public List<AnnotationMirror> getPartsOfMultiValuedConstraint(AnnotationMirror annotationMirror)
annotationMirror
- An array-valued annotation mirror (meaning it has an
array-typed attribute with name "value").
public ConstraintHelper.ConstraintCheckResult checkConstraint(DeclaredType constraintAnnotationType, TypeMirror typeOfAnnotatedElement)
constraintAnnotationType
- A constraint annotation type.typeOfAnnotatedElement
- A type which with an element is annotated.
public boolean isComposedConstraint(TypeElement element)
element
- The type element of interest. Must not be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |