public class ConstraintHelper extends Object
Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
ConstraintHelper(Types typeUtils,
AnnotationApiHelper annotationApiHelper) |
Modifier and Type | Method and Description |
---|---|
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.
|
public ConstraintHelper(Types typeUtils, AnnotationApiHelper annotationApiHelper)
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.Copyright © 2007-2014 Red Hat Middleware, LLC. All Rights Reserved