@Internal public class AnnotationUtils extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
AnnotationUtils(javax.annotation.processing.ProcessingEnvironment processingEnv,
javax.lang.model.util.Elements elementUtils,
javax.annotation.processing.Messager messager,
javax.lang.model.util.Types types,
ModelUtils modelUtils,
GenericUtils genericUtils,
javax.annotation.processing.Filer filer)
Default constructor.
|
protected |
AnnotationUtils(javax.annotation.processing.ProcessingEnvironment processingEnv,
javax.lang.model.util.Elements elementUtils,
javax.annotation.processing.Messager messager,
javax.lang.model.util.Types types,
ModelUtils modelUtils,
GenericUtils genericUtils,
javax.annotation.processing.Filer filer,
MutableConvertibleValues<java.lang.Object> visitorAttributes)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
AnnotationMetadata |
getAnnotationMetadata(javax.lang.model.element.Element element)
Get the annotation metadata for the given element.
|
AnnotationMetadata |
getAnnotationMetadata(javax.lang.model.element.Element parent,
javax.lang.model.element.Element element)
Get the annotation metadata for the given element and the given parent.
|
AnnotationMetadata |
getDeclaredAnnotationMetadata(javax.lang.model.element.Element element)
Get the declared annotation metadata for the given element.
|
AnnotatedElementValidator |
getElementValidator()
The
AnnotatedElementValidator instance. |
protected boolean |
hasStereotype(javax.lang.model.element.Element element,
java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Return whether the given element is annotated with the given annotation stereotype.
|
protected boolean |
hasStereotype(javax.lang.model.element.Element element,
java.util.List<java.lang.String> stereotypes)
Return whether the given element is annotated with any of the given annotation stereotypes.
|
protected boolean |
hasStereotype(javax.lang.model.element.Element element,
java.lang.String... stereotypes)
Return whether the given element is annotated with the given annotation stereotypes.
|
void |
invalidateMetadata(javax.lang.model.element.Element element)
Invalidates any cached metadata.
|
boolean |
isAnnotated(java.lang.String declaringType,
javax.lang.model.element.ExecutableElement method)
Check whether the method is annotated.
|
JavaAnnotationMetadataBuilder |
newAnnotationBuilder()
Creates a new annotation builder.
|
JavaVisitorContext |
newVisitorContext()
Creates a new
JavaVisitorContext. |
protected AnnotationUtils(javax.annotation.processing.ProcessingEnvironment processingEnv,
javax.lang.model.util.Elements elementUtils,
javax.annotation.processing.Messager messager,
javax.lang.model.util.Types types,
ModelUtils modelUtils,
GenericUtils genericUtils,
javax.annotation.processing.Filer filer,
MutableConvertibleValues<java.lang.Object> visitorAttributes)
processingEnv - The processing envelementUtils - The elementsmessager - The messagertypes - The typesmodelUtils - The model utilsgenericUtils - The generic utilsfiler - The filervisitorAttributes - The visitor attributesprotected AnnotationUtils(javax.annotation.processing.ProcessingEnvironment processingEnv,
javax.lang.model.util.Elements elementUtils,
javax.annotation.processing.Messager messager,
javax.lang.model.util.Types types,
ModelUtils modelUtils,
GenericUtils genericUtils,
javax.annotation.processing.Filer filer)
processingEnv - The processing envelementUtils - The elementsmessager - The messagertypes - The typesmodelUtils - The model utilsgenericUtils - The generic utilsfiler - The filer@Nullable public AnnotatedElementValidator getElementValidator()
AnnotatedElementValidator instance. Can be null.protected boolean hasStereotype(javax.lang.model.element.Element element,
java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
element - The elementstereotype - The stereotypeprotected boolean hasStereotype(javax.lang.model.element.Element element,
java.lang.String... stereotypes)
element - The elementstereotypes - The stereotypesprotected boolean hasStereotype(javax.lang.model.element.Element element,
java.util.List<java.lang.String> stereotypes)
element - The elementstereotypes - The stereotypespublic AnnotationMetadata getAnnotationMetadata(javax.lang.model.element.Element element)
element - The elementAnnotationMetadatapublic AnnotationMetadata getDeclaredAnnotationMetadata(javax.lang.model.element.Element element)
element - The elementAnnotationMetadatapublic AnnotationMetadata getAnnotationMetadata(javax.lang.model.element.Element parent, javax.lang.model.element.Element element)
parent - The parentelement - The elementAnnotationMetadatapublic boolean isAnnotated(java.lang.String declaringType,
javax.lang.model.element.ExecutableElement method)
declaringType - The declaring typemethod - The methodpublic JavaAnnotationMetadataBuilder newAnnotationBuilder()
public JavaVisitorContext newVisitorContext()
JavaVisitorContext.@Internal public void invalidateMetadata(javax.lang.model.element.Element element)
element - The element