Class AbstractBeanConfiguration

java.lang.Object
io.micronaut.context.AbstractBeanConfiguration
All Implemented Interfaces:
AnnotationMetadataProvider, AnnotationSource, BeanConfiguration, BeanContextConditional

@Internal public abstract class AbstractBeanConfiguration extends Object implements BeanConfiguration
An abstract implementation of the BeanConfiguration method. Not typically used directly from user code, instead an implementation will perform analysis on package-info files generate a configuration definition for a given package.
Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • AbstractBeanConfiguration

      protected AbstractBeanConfiguration(String thePackage)
      Parameters:
      thePackage - The package name
  • Method Details

    • getPackage

      public Package getPackage()
      Specified by:
      getPackage in interface BeanConfiguration
      Returns:
      The package for the bean configuration
    • getName

      public String getName()
      Specified by:
      getName in interface BeanConfiguration
      Returns:
      The package name this configuration
    • getVersion

      public String getVersion()
      Description copied from interface: BeanConfiguration
      The version of this configuration. Note: returns null when called on a configuration not provided by a JAR.
      Specified by:
      getVersion in interface BeanConfiguration
      Returns:
      The version or null
    • isWithin

      public boolean isWithin(BeanDefinitionReference beanDefinitionReference)
      Description copied from interface: BeanConfiguration
      Check whether the specified bean definition class is within this bean configuration.
      Specified by:
      isWithin in interface BeanConfiguration
      Parameters:
      beanDefinitionReference - The bean definition class
      Returns:
      True if it is
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isWithin

      public boolean isWithin(String className)
      Description copied from interface: BeanConfiguration
      Check whether the specified class is within this bean configuration.
      Specified by:
      isWithin in interface BeanConfiguration
      Parameters:
      className - The class name
      Returns:
      True if it is
    • isEnabled

      public boolean isEnabled(@NonNull @NonNull BeanContext context, @Nullable @Nullable BeanResolutionContext resolutionContext)
      Description copied from interface: BeanContextConditional
      Return whether this component is enabled for the given context.
      Specified by:
      isEnabled in interface BeanContextConditional
      Parameters:
      context - The context
      resolutionContext - The bean resolution context
      Returns:
      True if it is
    • onFail

      protected final void onFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext)