Package io.micronaut.core.annotation
Interface AnnotationMetadataProvider
- All Superinterfaces:
AnnotationSource
- All Known Subinterfaces:
AbstractAnnotationMetadataBuilder.CachedAnnotationMetadata
,AdvisedBeanType<T>
,AnnotatedElement
,AnnotationElement
,AnnotationMetadataDelegate
,Argument<T>
,ArgumentConversionContext<T>
,ArgumentInjectionPoint<B,
,T> ArgumentValue<V>
,ArrayableClassElement
,BeanConfiguration
,BeanConstructor<T>
,BeanConstructorElement
,BeanDefinition<T>
,BeanDefinitionMethodReference<T,
,R> BeanDefinitionReference<T>
,BeanElement
,BeanElementBuilder
,BeanFieldElement
,BeanInfo<T>
,BeanIntrospection<T>
,BeanIntrospectionReference<T>
,BeanMethod<B,
,T> BeanMethodElement
,BeanParameterElement
,BeanProperty<B,
,T> BeanType<T>
,BeanWrapper<T>
,BoundExecutable<T,
,R> CallableInjectionPoint<T>
,ClassElement
,ConfigurableElement
,ConstructorElement
,ConstructorInjectionPoint<T>
,ConstructorInvocationContext<T>
,ConversionContext
,DelegatingBeanDefinition<T>
,DelegatingExecutableMethod<T,
,R> DisposableBeanDefinition<T>
,Element
,ElementAnnotationMetadata
,ElementMutableAnnotationMetadataDelegate<R>
,EnumConstantElement
,EnumElement
,ErrorRouteInfo<T,
,R> Executable<T,
,R> ExecutableMethod<T,
,R> ExecutionHandle<T,
,R> FieldElement
,FieldInjectionPoint<B,
,T> FilterRoute
,GenericElement
,GenericPlaceholder<T>
,GenericPlaceholderElement
,GraalReflectionConfigurer
,HttpFilterResolver.FilterEntry
,ImmutableArgumentConversionContext<T>
,InitializingBeanDefinition<T>
,InjectableBeanDefinition<T>
,InjectableElement
,InjectionPoint<T>
,InstantiatableBeanDefinition<T>
,InvocationContext<T,
,R> MemberElement
,MethodBasedRouteInfo<T,
,R> MethodBasedRouteMatch<T,
,R> MethodElement
,MethodExecutionHandle<T,
,R> MethodInjectionPoint<B,
,T> MethodInvocationContext<T,
,R> MethodReference<T,
,R> MutableAnnotationMetadataDelegate<R>
,MutableArgumentValue<V>
,PackageElement
,ParameterElement
,ParametrizedInstantiatableBeanDefinition<T>
,PropertyElement
,ProxyBeanDefinition<T>
,QualifiedBeanType<T>
,ReturnType<T>
,RouteInfo<R>
,RouteMatch<R>
,RuntimeBeanDefinition<T>
,StatusRouteInfo<T,
,R> TypedElement
,TypeInformation<T>
,UnsafeBeanInstantiationIntrospection<T>
,UnsafeBeanProperty<B,
,T> UnsafeExecutable<T,
,R> UnsafeExecutionHandle<T,
,R> UriRouteInfo<T,
,R> UriRouteMatch<T,
,R> ValidatedBeanDefinition<T>
,WildcardElement
- All Known Implementing Classes:
AbstractAnnotationElement
,AbstractBeanConfiguration
,AbstractBeanConstructor
,AbstractBeanDefinitionBeanConstructor
,AbstractBeanDefinitionBuilder
,AbstractBeanIntrospectionReference
,AbstractBeanMethod
,AbstractBeanProperty
,AbstractBeanResolutionContext.AnnotationSegment
,AbstractBeanResolutionContext.ConstructorArgumentSegment
,AbstractBeanResolutionContext.FieldSegment
,AbstractBeanResolutionContext.MethodArgumentSegment
,AbstractBeanResolutionContext.MethodSegment
,AbstractElementAnnotationMetadata
,AbstractElementAnnotationMetadataFactory.AbstractElementAnnotationMetadata
,AbstractElementAnnotationMetadataFactory.MutableElementAnnotationMetadata
,AbstractExecutableBeanMethod
,AbstractExecutableMethod
,AbstractGroovyElement
,AbstractInitializableBeanDefinition
,AbstractInitializableBeanDefinitionReference
,AbstractInitializableBeanIntrospection
,AbstractJavaElement
,AbstractMutableAnnotationMetadata
,AbstractProviderDefinition
,AnnotationMetadataReference
,ApplicationEventPublisherFactory
,ArgumentBeanType
,BeanDefinitionWriter
,BeanProviderDefinition
,BeanRegistration
,ClientFilterResolutionContext
,ConstructorInterceptorChain
,DefaultArgument
,DefaultErrorRouteInfo
,DefaultRequestMatcher
,DefaultRouteInfo
,DefaultStatusRouteInfo
,DefaultUrlRouteInfo
,DisabledBean
,EvaluatedAnnotationMetadata
,GenericArgument
,GenericPlaceholderElementAnnotationMetadata
,GroovyClassElement
,GroovyConstructorElement
,GroovyEnumConstantElement
,GroovyFieldElement
,GroovyMethodElement
,GroovyPackageElement
,GroovyParameterElement
,InterceptorChain
,InterceptorRegistryBean
,JakartaProviderBeanDefinition
,JavaClassElement
,JavaMethodElement
,JavaPackageElement
,JavaxProviderBeanDefinition
,MappingAnnotationMetadataDelegate
,MethodElementAnnotationMetadata
,MethodInterceptorChain
,MutatedMethodElementAnnotationMetadata
,PrimitiveElement
,PropertyElementAnnotationMetadata
,WildcardElementAnnotationMetadata
An interface for a type that provides
AnnotationMetadata
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Annotation>
Optional<AnnotationValue<T>>findAnnotation
(Class<T> annotationClass) Find anAnnotationValue
for the given annotation type.default <T extends Annotation>
Optional<AnnotationValue<T>>findAnnotation
(String annotation) Find anAnnotationValue
for the given annotation name.default <T extends Annotation>
Optional<AnnotationValue<T>>findDeclaredAnnotation
(Class<T> annotationClass) Get all of the values for the given annotation that are directly declared on the annotated element.default <T extends Annotation>
Optional<AnnotationValue<T>>findDeclaredAnnotation
(String annotation) Get all of the values for the given annotation that are directly declared on the annotated element.default @NonNull AnnotationMetadata
Supplies the metadata.default AnnotationSource
Unwraps possible delegate or provider.default boolean
isAnnotationPresent
(Class<? extends Annotation> annotationClass) Return whether an annotation is present.default boolean
isDeclaredAnnotationPresent
(Class<? extends Annotation> annotationClass) Variation ofAnnotationSource.isAnnotationPresent(Class)
for declared annotations.default <T extends Annotation>
Tsynthesize
(Class<T> annotationClass) Synthesizes a new annotation from the metadata for the given annotation type.default Annotation[]
Synthesizes a new annotations from the metadata.default <T extends Annotation>
T[]synthesizeAnnotationsByType
(Class<T> annotationClass) Synthesizes a new annotations from the metadata for the given type.default Annotation[]
Synthesizes a new annotations from the metadata.default <T extends Annotation>
TsynthesizeDeclared
(Class<T> annotationClass) Synthesizes a new annotation from the metadata for the given annotation type.default <T extends Annotation>
T[]synthesizeDeclaredAnnotationsByType
(Class<T> annotationClass) Synthesizes a new annotations from the metadata for the given type.Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Method Details
-
getAnnotationMetadata
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Returns:
- The
AnnotationMetadata
-
synthesize
Description copied from interface:AnnotationSource
Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesize
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation class- Returns:
- The annotation or null if it doesn't exist
-
synthesizeAll
Description copied from interface:AnnotationSource
Synthesizes a new annotations from the metadata. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesizeAll
in interfaceAnnotationSource
- Returns:
- All the annotations
-
synthesizeDeclared
Description copied from interface:AnnotationSource
Synthesizes a new annotations from the metadata. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesizeDeclared
in interfaceAnnotationSource
- Returns:
- All declared annotations
-
isAnnotationPresent
Description copied from interface:AnnotationSource
Return whether an annotation is present.- Specified by:
isAnnotationPresent
in interfaceAnnotationSource
- Parameters:
annotationClass
- The annotation class- Returns:
- True if it is
-
isDeclaredAnnotationPresent
Description copied from interface:AnnotationSource
Variation ofAnnotationSource.isAnnotationPresent(Class)
for declared annotations.- Specified by:
isDeclaredAnnotationPresent
in interfaceAnnotationSource
- Parameters:
annotationClass
- The annotation class- Returns:
- True if it is
-
synthesizeDeclared
Description copied from interface:AnnotationSource
Synthesizes a new annotation from the metadata for the given annotation type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
- Specified by:
synthesizeDeclared
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation class- Returns:
- The annotation or null if it doesn't exist
-
synthesizeAnnotationsByType
Description copied from interface:AnnotationSource
Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesizeAnnotationsByType
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation type- Returns:
- All annotations by the given type
-
synthesizeDeclaredAnnotationsByType
Description copied from interface:AnnotationSource
Synthesizes a new annotations from the metadata for the given type. This method works by creating a runtime proxy of the annotation interface and should be avoided in favour of direct use of the annotation metadata and only used for unique cases that require integrating third party libraries.- Specified by:
synthesizeDeclaredAnnotationsByType
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation generic type- Parameters:
annotationClass
- The annotation type- Returns:
- Declared annotations by the given type
-
findAnnotation
Description copied from interface:AnnotationSource
Find anAnnotationValue
for the given annotation name.- Specified by:
findAnnotation
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation type- Parameters:
annotation
- The annotation name- Returns:
- A
AnnotationValue
instance
-
findAnnotation
default <T extends Annotation> Optional<AnnotationValue<T>> findAnnotation(Class<T> annotationClass) Description copied from interface:AnnotationSource
Find anAnnotationValue
for the given annotation type.- Specified by:
findAnnotation
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation type- Parameters:
annotationClass
- The annotation- Returns:
- A
AnnotationValue
instance
-
findDeclaredAnnotation
default <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(String annotation) Description copied from interface:AnnotationSource
Get all of the values for the given annotation that are directly declared on the annotated element.- Specified by:
findDeclaredAnnotation
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation type- Parameters:
annotation
- The annotation name- Returns:
- A
AnnotationValue
instance
-
findDeclaredAnnotation
default <T extends Annotation> Optional<AnnotationValue<T>> findDeclaredAnnotation(Class<T> annotationClass) Description copied from interface:AnnotationSource
Get all of the values for the given annotation that are directly declared on the annotated element.- Specified by:
findDeclaredAnnotation
in interfaceAnnotationSource
- Type Parameters:
T
- The annotation type- Parameters:
annotationClass
- The annotation name- Returns:
- A
AnnotationValue
instance
-
getTargetAnnotationMetadata
Description copied from interface:AnnotationSource
Unwraps possible delegate or provider.- Specified by:
getTargetAnnotationMetadata
in interfaceAnnotationSource
- Returns:
- unwrapped
-