Package io.micronaut.context
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
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()The version of this configuration.booleanisEnabled(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.booleanisWithin(BeanDefinitionReference beanDefinitionReference) Check whether the specified bean definition class is within this bean configuration.booleanCheck whether the specified class is within this bean configuration.protected final voidonFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclaredMethods inherited from interface io.micronaut.inject.BeanConfiguration
isWithinMethods inherited from interface io.micronaut.inject.BeanContextConditional
isEnabled, isEnabled
-
Constructor Details
-
AbstractBeanConfiguration
- Parameters:
thePackage- The package name
-
-
Method Details
-
getPackage
- Specified by:
getPackagein interfaceBeanConfiguration- Returns:
- The package for the bean configuration
-
getName
- Specified by:
getNamein interfaceBeanConfiguration- Returns:
- The package name this configuration
-
getVersion
Description copied from interface:BeanConfigurationThe version of this configuration. Note: returns null when called on a configuration not provided by a JAR.- Specified by:
getVersionin interfaceBeanConfiguration- Returns:
- The version or null
-
isWithin
Description copied from interface:BeanConfigurationCheck whether the specified bean definition class is within this bean configuration.- Specified by:
isWithinin interfaceBeanConfiguration- Parameters:
beanDefinitionReference- The bean definition class- Returns:
- True if it is
-
toString
-
isWithin
Description copied from interface:BeanConfigurationCheck whether the specified class is within this bean configuration.- Specified by:
isWithinin interfaceBeanConfiguration- 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:BeanContextConditionalReturn whether this component is enabled for the given context.- Specified by:
isEnabledin interfaceBeanContextConditional- Parameters:
context- The contextresolutionContext- 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)
-