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 Type
    Method
    Description
    boolean
    isAllowed(Class<?> type)
    Whether the application allows the type to be described reflectively.
    boolean
    register(Class<?> type)
    Registers 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

      boolean isAllowed(Class<?> type)
      Whether the application allows the type to be described reflectively.
      Parameters:
      type - The type
      Returns:
      true if it may be registered
    • register

      boolean register(Class<?> type)
      Registers a definition for the type, if it is allowed and not registered already.
      Parameters:
      type - The type
      Returns:
      true if a definition now exists for the type
    • resolveTypeArgument

      @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.
      Parameters:
      type - The class
      interfaceType - The generic interface
      Returns:
      The type argument, or null when the class does not implement the interface