Interface ReflectiveBeanDefinitions
@Internal
public interface ReflectiveBeanDefinitions
Registers a class the annotation processors never saw as a bean, reflectively.
The one implementation lives behind micronaut-reflection; without that module on the
classpath no bean of this type exists and nothing is ever instantiated reflectively.
- Since:
- 6.2.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the application allows the type to be described reflectively.booleanRegisters a definition for the type, if it is allowed and not registered already.@Nullable Class<?> resolveTypeArgument(Class<?> type, Class<?> interfaceType) Resolves the type argument a class gives to one of its generic interfaces, from the class's generic signature.
-
Method Details
-
isAllowed
Whether the application allows the type to be described reflectively.- Parameters:
type- The type- Returns:
trueif it may be registered
-
register
Registers a definition for the type, if it is allowed and not registered already.- Parameters:
type- The type- Returns:
trueif a definition now exists for the type
-
resolveTypeArgument
Resolves the type argument a class gives to one of its generic interfaces, from the class's generic signature.- Parameters:
type- The classinterfaceType- The generic interface- Returns:
- The type argument, or
nullwhen the class does not implement the interface
-