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 -
Field Summary
Fields inherited from class io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder
ELEMENT_VALIDATOR -
Constructor Summary
ConstructorsConstructorDescriptionJavaAnnotationMetadataBuilder(Elements elements, Messager messager, AnnotationUtils annotationUtils, ModelUtils modelUtils) Deprecated, for removal: This API element is subject to removal in a future version.Not neededJavaAnnotationMetadataBuilder(Elements elements, Messager messager, ModelUtils modelUtils, JavaNativeElementsHelper nativeElementsHelper, JavaVisitorContext visitorContext) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidaddWarning(Element originatingElement, String warning) final io.micronaut.core.annotation.AnnotationMetadatabuild(RecordComponentElement recordComponentElement) Build the record component annotation metadata.buildHierarchy(Element element, boolean inheritTypeAnnotations, boolean declaredOnly) static voidClears any caches from the last compilation round.protected @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 StringgetOriginatingClassName(Element orginatingElement) protected @Nullable StringgetRepeatableContainerNameForType(Element annotationType) protected @Nullable StringgetRepeatableName(AnnotationMirror annotationMirror) protected RetentionPolicygetRetentionPolicy(Element annotation) protected ElementgetTypeForAnnotation(AnnotationMirror annotationMirror) protected io.micronaut.inject.visitor.VisitorContextbooleanhasAnnotation(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(Element element, String annotationName) protected booleanisValidationRequired(Element member) readAnnotationDefaultValues(String annotationTypeName, Element element) readAnnotationDefaultValues(String annotationTypeName, Element element, boolean includeEmptyValues) readAnnotationRawValues(AnnotationMirror annotationMirror) protected voidreadAnnotationRawValues(Element originatingElement, String annotationName, Element member, String memberName, Object annotationValue, Map<CharSequence, Object> annotationValues) protected voidreadAnnotationRawValues(Element originatingElement, String annotationName, Element member, String memberName, Object annotationValue, Map<CharSequence, Object> annotationValues, Map<String, Map<CharSequence, Object>> resolvedDefaults) protected ObjectreadAnnotationValue(Element originatingElement, Element member, String annotationName, String memberName, Object annotationValue) Methods inherited from class io.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder
annotate, buildAnnotation, buildDeclared, buildEvaluatedExpressionReference, buildInternal, clearMutated, clearMutated, copyToRuntime, findRepeatableContainerNameForType, getAnnotationDefaultValues, getAnnotationMappers, getAnnotationTransformers, getCachedAnnotationDefaults, getElementValidator, getMappedAnnotationNames, getMappedAnnotationPackages, getRetentionPolicy, isEvaluatedExpression, isRepeatableAnnotationContainer, lookupOrBuild, lookupOrBuildForField, lookupOrBuildForMethod, lookupOrBuildForParameter, lookupOrBuildForType, postProcess, readNestedAnnotationValue, readNestedAnnotationValue, removeAnnotation, removeAnnotationIf, removeStereotype, validateAnnotationValue
-
Constructor Details
-
JavaAnnotationMetadataBuilder
@Deprecated(forRemoval=true, since="4.3.0") public JavaAnnotationMetadataBuilder(Elements elements, Messager messager, AnnotationUtils annotationUtils, ModelUtils modelUtils) Deprecated, for removal: This API element is subject to removal in a future version.Not neededDefault constructor.- Parameters:
elements- The elementUtilsmessager- The messagerannotationUtils- The annotation utilsmodelUtils- The model utils
-
JavaAnnotationMetadataBuilder
public JavaAnnotationMetadataBuilder(Elements elements, Messager messager, ModelUtils modelUtils, JavaNativeElementsHelper nativeElementsHelper, JavaVisitorContext visitorContext) Default constructor.- Parameters:
elements- The elementUtilsmessager- The messagermodelUtils- The model utilsnativeElementsHelper- The native elements helpervisitorContext- The visitor context
-
-
Method Details
-
addError
- Specified by:
addErrorin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
addWarning
- 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>
-
getRepeatableContainerNameForType
- Specified by:
getRepeatableContainerNameForTypein classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
getAnnotationMirror
- Specified by:
getAnnotationMirrorin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
getVisitorContext
protected io.micronaut.inject.visitor.VisitorContext getVisitorContext()- Specified by:
getVisitorContextin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
getRetentionPolicy
- 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
- Overrides:
isExcludedAnnotationin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
build
public final io.micronaut.core.annotation.AnnotationMetadata build(RecordComponentElement recordComponentElement) Build the record component annotation metadata.- Parameters:
recordComponentElement- The element- Returns:
- The annotation metadata
- Since:
- 4.10
-
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
- 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>
-
readAnnotationRawValues
protected void readAnnotationRawValues(Element originatingElement, String annotationName, Element member, String memberName, Object annotationValue, Map<CharSequence, Object> annotationValues, Map<String, Map<CharSequence, Object>> resolvedDefaults) - Overrides:
readAnnotationRawValuesin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
isValidationRequired
- Specified by:
isValidationRequiredin classio.micronaut.inject.annotation.AbstractAnnotationMetadataBuilder<Element, AnnotationMirror>
-
readAnnotationValue
-
readAnnotationDefaultValues
-
readAnnotationDefaultValues
-
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
-