Class JavaAnnotationMetadataBuilder
java.lang.Object
io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
io.micronaut.annotation.processing.JavaAnnotationMetadataBuilder
public class JavaAnnotationMetadataBuilder
extends io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
A
AnnotationMetadata for builder for Java to be used at compile time.- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder
io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder.CachedAnnotationMetadata -
Constructor Summary
ConstructorsConstructorDescriptionJavaAnnotationMetadataBuilder(Elements elements, Messager messager, AnnotationUtils annotationUtils, ModelUtils modelUtils) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidaddWarning(@NonNull Element originatingElement, @NonNull String warning) buildHierarchy(Element element, boolean inheritTypeAnnotations, boolean declaredOnly) static voidClears any caches from the last compilation round.protected io.micronaut.inject.visitor.VisitorContextprotected @Nullable ElementgetAnnotationMember(Element annotationElement, CharSequence member) protected StringgetAnnotationMemberName(Element member) getAnnotationMirror(String annotationName) protected List<? extends AnnotationMirror>getAnnotationsForType(Element element) protected StringgetAnnotationTypeName(AnnotationMirror annotationMirror) protected <K extends Annotation>
Optional<io.micronaut.core.annotation.AnnotationValue<K>>getAnnotationValues(Element originatingElement, Element member, Class<K> annotationType) protected StringgetElementName(Element element) protected @Nullable io.micronaut.inject.annotation.AnnotatedElementValidatorprotected StringgetOriginatingClassName(Element orginatingElement) protected @Nullable StringgetRepeatableName(AnnotationMirror annotationMirror) protected @Nullable StringgetRepeatableNameForType(Element annotationType) protected @NonNull RetentionPolicygetRetentionPolicy(@NonNull Element annotation) protected ElementgetTypeForAnnotation(AnnotationMirror annotationMirror) booleanhasAnnotation(Element element, Class<? extends Annotation> ann) Checks if a method has an annotation.booleanhasAnnotation(Element element, String ann) Checks if a method has an annotation.static booleanhasAnnotation(ExecutableElement method, Class<? extends Annotation> ann) Checks if a method has an annotation.protected booleanhasAnnotations(Element element) protected booleanisExcludedAnnotation(@NonNull Element element, @NonNull String annotationName) protected booleanisValidationRequired(Element member) readAnnotationDefaultValues(String annotationTypeName, Element element) readAnnotationRawValues(AnnotationMirror annotationMirror) protected voidreadAnnotationRawValues(Element originatingElement, String annotationName, Element member, String memberName, Object annotationValue, Map<CharSequence, Object> annotationValues) protected ObjectreadAnnotationValue(Element originatingElement, Element member, String annotationName, String memberName, Object annotationValue) Methods inherited from class io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder
annotate, buildDeclared, buildEvaluatedExpressionReference, clearMutated, copyToRuntime, getAnnotationMappers, getAnnotationTransformers, getCachedAnnotationDefaults, getMappedAnnotationNames, getMappedAnnotationPackages, getRetentionPolicy, isEvaluatedExpression, lookupOrBuild, lookupOrBuildForField, lookupOrBuildForMethod, lookupOrBuildForParameter, lookupOrBuildForType, postProcess, readNestedAnnotationValue, removeAnnotation, removeAnnotationIf, removeStereotype, validateAnnotationValue
-
Constructor Details
-
JavaAnnotationMetadataBuilder
public JavaAnnotationMetadataBuilder(Elements elements, Messager messager, AnnotationUtils annotationUtils, ModelUtils modelUtils) Default constructor.- Parameters:
elements- The elementUtilsmessager- The messagerannotationUtils- The annotation utilsmodelUtils- The model utils
-
-
Method Details
-
getElementValidator
@Nullable protected @Nullable io.micronaut.inject.annotation.AnnotatedElementValidator getElementValidator()- Overrides:
getElementValidatorin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
addError
protected void addError(@NonNull @NonNull Element originatingElement, @NonNull @NonNull String error) - Specified by:
addErrorin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
addWarning
protected void addWarning(@NonNull @NonNull Element originatingElement, @NonNull @NonNull String warning) - Specified by:
addWarningin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getAnnotationMemberName
- Specified by:
getAnnotationMemberNamein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getRepeatableName
- Specified by:
getRepeatableNamein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getRepeatableNameForType
- Specified by:
getRepeatableNameForTypein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getAnnotationMirror
- Specified by:
getAnnotationMirrorin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
createVisitorContext
protected io.micronaut.inject.visitor.VisitorContext createVisitorContext()- Specified by:
createVisitorContextin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getRetentionPolicy
@NonNull protected @NonNull RetentionPolicy getRetentionPolicy(@NonNull @NonNull Element annotation) - Specified by:
getRetentionPolicyin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getTypeForAnnotation
- Specified by:
getTypeForAnnotationin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getAnnotationsForType
- Specified by:
getAnnotationsForTypein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
isExcludedAnnotation
protected boolean isExcludedAnnotation(@NonNull @NonNull Element element, @NonNull @NonNull String annotationName) - Overrides:
isExcludedAnnotationin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
buildHierarchy
protected List<Element> buildHierarchy(Element element, boolean inheritTypeAnnotations, boolean declaredOnly) - Specified by:
buildHierarchyin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
readAnnotationRawValues
- Specified by:
readAnnotationRawValuesin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getAnnotationMember
@Nullable protected @Nullable Element getAnnotationMember(Element annotationElement, CharSequence member) - Specified by:
getAnnotationMemberin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getOriginatingClassName
- Specified by:
getOriginatingClassNamein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getAnnotationValues
protected <K extends Annotation> Optional<io.micronaut.core.annotation.AnnotationValue<K>> getAnnotationValues(Element originatingElement, Element member, Class<K> annotationType) - Specified by:
getAnnotationValuesin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
readAnnotationRawValues
protected void readAnnotationRawValues(Element originatingElement, String annotationName, Element member, String memberName, Object annotationValue, Map<CharSequence, Object> annotationValues) - Specified by:
readAnnotationRawValuesin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
isValidationRequired
- Specified by:
isValidationRequiredin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
readAnnotationValue
protected Object readAnnotationValue(Element originatingElement, Element member, String annotationName, String memberName, Object annotationValue) - Specified by:
readAnnotationValuein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
readAnnotationDefaultValues
protected Map<? extends Element,?> readAnnotationDefaultValues(String annotationTypeName, Element element) - Specified by:
readAnnotationDefaultValuesin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getAnnotationTypeName
- Specified by:
getAnnotationTypeNamein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
getElementName
- Specified by:
getElementNamein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
hasAnnotation
Checks if a method has an annotation.- Specified by:
hasAnnotationin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror> - Parameters:
element- The methodann- The annotation to look for- Returns:
- Whether if the method has the annotation
-
hasAnnotation
Checks if a method has an annotation.- Specified by:
hasAnnotationin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror> - Parameters:
element- The methodann- The annotation to look for- Returns:
- Whether if the method has the annotation
-
hasAnnotations
- Specified by:
hasAnnotationsin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element,AnnotationMirror>
-
clearCaches
public static void clearCaches()Clears any caches from the last compilation round. -
hasAnnotation
Checks if a method has an annotation.- Parameters:
method- The methodann- The annotation to look for- Returns:
- Whether if the method has the annotation
-