Package io.micronaut.core.beans
Interface BeanIntrospector
-
@Immutable public interface BeanIntrospector
Primary interface for obtainingBeanIntrospection
instances that are computed at compilation time.- Since:
- 1.0
- See Also:
Introspected
,BeanIntrospection
-
-
Field Summary
Fields Modifier and Type Field Description static BeanIntrospector
SHARED
The default sharedBeanIntrospector
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Collection<java.lang.Class<?>>
findIntrospectedTypes(java.util.function.Predicate<? super BeanIntrospectionReference<?>> filter)
Finds introspections with the given filter.<T> java.util.Optional<BeanIntrospection<T>>
findIntrospection(java.lang.Class<T> beanType)
Find aBeanIntrospection
for the given bean type.default java.util.Collection<BeanIntrospection<java.lang.Object>>
findIntrospections(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Finds introspections for classes annotated with the given stereotype.default java.util.Collection<BeanIntrospection<java.lang.Object>>
findIntrospections(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype, java.lang.String... packageNames)
Finds introspections for classes annotated with the given stereotype.java.util.Collection<BeanIntrospection<java.lang.Object>>
findIntrospections(java.util.function.Predicate<? super BeanIntrospectionReference<?>> filter)
Finds introspections with the given filter.static BeanIntrospector
forClassLoader(java.lang.ClassLoader classLoader)
Creates a new default bean introspector that uses the given classloader.default <T> BeanIntrospection<T>
getIntrospection(java.lang.Class<T> beanType)
Retrieves an introspection for the given type.
-
-
-
Field Detail
-
SHARED
static final BeanIntrospector SHARED
The default sharedBeanIntrospector
.
-
-
Method Detail
-
forClassLoader
static BeanIntrospector forClassLoader(java.lang.ClassLoader classLoader)
Creates a new default bean introspector that uses the given classloader.- Parameters:
classLoader
- The class loader to load introspections- Returns:
- A new bean introspector
- Since:
- 3.0.1
-
findIntrospections
@NonNull java.util.Collection<BeanIntrospection<java.lang.Object>> findIntrospections(@NonNull java.util.function.Predicate<? super BeanIntrospectionReference<?>> filter)
Finds introspections with the given filter.- Parameters:
filter
- A filter that receives aBeanIntrospectionReference
- Returns:
- A collection of introspections
-
findIntrospectedTypes
@NonNull java.util.Collection<java.lang.Class<?>> findIntrospectedTypes(@NonNull java.util.function.Predicate<? super BeanIntrospectionReference<?>> filter)
Finds introspections with the given filter.- Parameters:
filter
- A filter that receives aBeanIntrospectionReference
- Returns:
- A collection of introspections
- Since:
- 3.0
-
findIntrospection
@NonNull <T> java.util.Optional<BeanIntrospection<T>> findIntrospection(@NonNull java.lang.Class<T> beanType)
Find aBeanIntrospection
for the given bean type.- Type Parameters:
T
- The bean generic type- Parameters:
beanType
- The bean type- Returns:
- An optional introspection
-
findIntrospections
@NonNull default java.util.Collection<BeanIntrospection<java.lang.Object>> findIntrospections(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Finds introspections for classes annotated with the given stereotype.- Parameters:
stereotype
- The stereotype- Returns:
- The introspections
-
findIntrospections
@NonNull default java.util.Collection<BeanIntrospection<java.lang.Object>> findIntrospections(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> stereotype, @NonNull java.lang.String... packageNames)
Finds introspections for classes annotated with the given stereotype.- Parameters:
stereotype
- The stereotypepackageNames
- The package names to include in the search- Returns:
- The introspections
-
getIntrospection
@NonNull default <T> BeanIntrospection<T> getIntrospection(@NonNull java.lang.Class<T> beanType)
Retrieves an introspection for the given type.- Type Parameters:
T
- The bean generic type- Parameters:
beanType
- The bean type- Returns:
- The introspection
- Throws:
IntrospectionException
- If no introspection data is found and the bean is not annotated withIntrospected
-
-