Package io.micronaut.core.beans
Interface BeanIntrospectionReference<T>
-
- Type Parameters:
T
- The bean type
- All Superinterfaces:
AnnotationMetadataProvider
,AnnotationSource
,Named
- All Known Implementing Classes:
AbstractBeanIntrospectionReference
@Internal public interface BeanIntrospectionReference<T> extends AnnotationMetadataProvider, Named
A reference to aBeanIntrospection
that may or may not be present on the classpath.This interface allows soft loading a
BeanIntrospection
without knowing if the class is present on the classpath or not. It also ensures that less memory is occupied as only a reference to the annotation metadata is retained and the full bean can be loaded via theload()
method.In general results of the
load()
do not need to be cached as object creation is cheap and no runtime analysis is performed so it is extremely fast.- Since:
- 1.1
-
-
Field Summary
-
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<T>
getBeanType()
The type.boolean
isPresent()
BeanIntrospection<T>
load()
Loads the introspection.-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
-
-
-
Method Detail
-
isPresent
boolean isPresent()
- Returns:
- Is the introspection present?
-
getBeanType
@NonNull java.lang.Class<T> getBeanType()
The type. The methodisPresent()
should be checked first.- Returns:
- The type
- Throws:
IntrospectionException
- if the introspection cannot be loaded
-
load
@NonNull BeanIntrospection<T> load()
Loads the introspection.- Returns:
- The loaded introspection.
- Throws:
IntrospectionException
- if the introspection cannot be loaded
-
-