Interface BeanConfiguration

All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, BeanContextConditional
All Known Implementing Classes:
AbstractBeanConfiguration

public interface BeanConfiguration extends io.micronaut.core.annotation.AnnotationMetadataProvider, BeanContextConditional
A BeanConfiguration is a grouping of several BeanDefinition instances.
Since:
1.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY
  • Method Summary

    Modifier and Type
    Method
    Description
    disabled(String thePackage)
    Programmatically disable beans within a package.
     
     
    @Nullable String
    The version of this configuration.
    default boolean
    isWithin(BeanDefinitionReference<?> beanDefinitionReference)
    Check whether the specified bean definition class is within this bean configuration.
    default boolean
    Check whether the specified class is within this bean configuration.
    default boolean
    isWithin(String className)
    Check whether the specified class is within this bean configuration.
    of(Package thePackage, Predicate<BeanContext> condition)
    Programmatically create a bean configuration for the given package.
    of(String thePackage, Predicate<BeanContext> condition)
    Programmatically create a bean configuration for the given package.

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, 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

    Methods inherited from interface BeanContextConditional

    isEnabled, isEnabled
  • Method Details

    • getPackage

      Package getPackage()
      Returns:
      The package for the bean configuration
    • getName

      String getName()
      Returns:
      The package name this configuration
    • getVersion

      @Nullable String getVersion()
      The version of this configuration. Note: returns null when called on a configuration not provided by a JAR.
      Returns:
      The version or null
    • isWithin

      default boolean isWithin(BeanDefinitionReference<?> beanDefinitionReference)
      Check whether the specified bean definition class is within this bean configuration.
      Parameters:
      beanDefinitionReference - The bean definition class
      Returns:
      True if it is
    • isWithin

      default boolean isWithin(String className)
      Check whether the specified class is within this bean configuration.
      Parameters:
      className - The class name
      Returns:
      True if it is
    • isWithin

      default boolean isWithin(Class cls)
      Check whether the specified class is within this bean configuration.
      Parameters:
      cls - The class
      Returns:
      True if it is
    • of

      static BeanConfiguration of(Package thePackage, Predicate<BeanContext> condition)
      Programmatically create a bean configuration for the given package.
      Parameters:
      thePackage - The package
      condition - The condition
      Returns:
      The bean configuration
      Since:
      4.8.0
    • of

      static BeanConfiguration of(String thePackage, Predicate<BeanContext> condition)
      Programmatically create a bean configuration for the given package.
      Parameters:
      thePackage - The package
      condition - The condition
      Returns:
      The bean configuration
      Since:
      4.8.0
    • disabled

      static BeanConfiguration disabled(String thePackage)
      Programmatically disable beans within a package.
      Parameters:
      thePackage - The package name
      Returns:
      The bean configuration
      Since:
      4.8.0