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(javax.lang.model.util.Elements elementUtils,
javax.lang.model.util.Types typeUtils,
AnnotationApiHelper annotationApiHelper) |
| Modifier and Type | Method and Description |
|---|---|
ConstraintHelper.ConstraintCheckResult |
checkConstraint(javax.lang.model.type.DeclaredType constraintAnnotationType,
javax.lang.model.type.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(javax.lang.model.element.AnnotationMirror annotationMirror)
Returns the
ConstraintHelper.AnnotationType of the given annotation. |
List<javax.lang.model.element.AnnotationMirror> |
getPartsOfMultiValuedConstraint(javax.lang.model.element.AnnotationMirror annotationMirror)
Returns a list with the constraint annotations contained in the given
array-valued annotation mirror.
|
boolean |
isComposedConstraint(javax.lang.model.element.TypeElement element)
Checks, whether the given type element represents a composed constraint or not.
|
boolean |
isConstraintAnnotation(javax.lang.model.element.Element element)
Checks, whether the given type element represents a constraint annotation
or not.
|
public ConstraintHelper(javax.lang.model.util.Elements elementUtils,
javax.lang.model.util.Types typeUtils,
AnnotationApiHelper annotationApiHelper)
public boolean isConstraintAnnotation(javax.lang.model.element.Element element)
Constraint meta-annotation (which is only allowed at annotation
declarations).element - The element of interest.public ConstraintHelper.AnnotationType getAnnotationType(javax.lang.model.element.AnnotationMirror annotationMirror)
ConstraintHelper.AnnotationType of the given annotation.annotationMirror - The annotation mirror of interest.public List<javax.lang.model.element.AnnotationMirror> getPartsOfMultiValuedConstraint(javax.lang.model.element.AnnotationMirror annotationMirror)
annotationMirror - An array-valued annotation mirror (meaning it has an
array-typed attribute with name "value").public ConstraintHelper.ConstraintCheckResult checkConstraint(javax.lang.model.type.DeclaredType constraintAnnotationType, javax.lang.model.type.TypeMirror typeOfAnnotatedElement)
constraintAnnotationType - A constraint annotation type.typeOfAnnotatedElement - A type which with an element is annotated.public boolean isComposedConstraint(javax.lang.model.element.TypeElement element)
element - The type element of interest. Must not be null.Copyright © 2007-2012 Red Hat Middleware, LLC. All Rights Reserved