T
- The generic typepublic abstract class AbstractProviderDefinition<T> extends Object implements BeanDefinition<T>, BeanFactory<T>, BeanDefinitionReference<T>
NAMED_ATTRIBUTE
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
AbstractProviderDefinition() |
Modifier and Type | Method and Description |
---|---|
T |
build(BeanResolutionContext resolutionContext,
BeanContext context,
BeanDefinition<T> definition)
Builds a bean instance.
|
protected abstract T |
buildProvider(BeanResolutionContext resolutionContext,
BeanContext context,
Argument<Object> argument,
Qualifier<Object> qualifier,
boolean singleton)
Builds a provider implementation.
|
boolean |
equals(Object o) |
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
String |
getBeanDefinitionName() |
Qualifier<T> |
getDeclaredQualifier()
Resolve the declared qualifier for this bean.
|
List<Argument<?>> |
getTypeArguments()
If the bean itself declares any type arguments this method will return the classes that represent those types.
|
List<Argument<?>> |
getTypeArguments(Class<?> type)
Return the type arguments for the given interface or super type for this bean.
|
int |
hashCode() |
boolean |
isAbstract() |
protected boolean |
isAllowEmptyProviders(BeanContext context)
Return whether missing providers are allowed for this implementation.
|
boolean |
isContainerType()
Checks whether the bean type is a container type.
|
boolean |
isEnabled(BeanContext context,
BeanResolutionContext resolutionContext)
Return whether this component is enabled for the given context.
|
boolean |
isPresent() |
boolean |
isSingleton() |
BeanDefinition<T> |
load()
Loads the bean definition.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
asArgument, findMethod, findPossibleMethods, getBeanType, getConstructor, getContainerElement, getDeclaringType, getExecutableMethods, getInjectedFields, getInjectedMethods, getName, getPostConstructMethods, getPreDestroyMethods, getRequiredComponents, getRequiredMethod, getScope, getScopeName, getTypeArguments, getTypeParameters, getTypeParameters, inject, inject, isCandidateBean, isIterable, isProvided, isProxy, resolveDynamicQualifier
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
build
isConfigurationProperties, isContextScope, load
getExposedTypes, isPrimary, requiresMethodProcessing
isEnabled
public boolean isContainerType()
BeanType
isContainerType
in interface BeanType<T>
Iterable
.public boolean isEnabled(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext)
BeanContextConditional
isEnabled
in interface BeanContextConditional
context
- The contextresolutionContext
- The bean resolution contextpublic String getBeanDefinitionName()
getBeanDefinitionName
in interface BeanDefinitionReference<T>
BeanDefinition
public BeanDefinition<T> load()
BeanDefinitionReference
load
in interface BeanDefinitionReference<T>
public boolean isPresent()
isPresent
in interface BeanDefinitionReference<T>
@NonNull protected abstract T buildProvider(@NonNull BeanResolutionContext resolutionContext, @NonNull BeanContext context, @NonNull Argument<Object> argument, @Nullable Qualifier<Object> qualifier, boolean singleton)
resolutionContext
- The resolution contextcontext
- The contextargument
- The argumentqualifier
- The qualifiersingleton
- Whether the bean is a singletonpublic T build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition) throws BeanInstantiationException
BeanFactory
build
in interface BeanFactory<T>
resolutionContext
- The bean resolution contextcontext
- The contextdefinition
- The definitionBeanInstantiationException
- if the instance could not be instantiatedprotected boolean isAllowEmptyProviders(BeanContext context)
false
a NoSuchBeanException
is thrown.context
- The contexttrue
if missing providers are allowedpublic final boolean isAbstract()
isAbstract
in interface BeanDefinition<T>
public final boolean isSingleton()
isSingleton
in interface BeanDefinition<T>
isSingleton
in interface BeanDefinitionReference<T>
@NonNull public final List<Argument<?>> getTypeArguments(Class<?> type)
BeanDefinition
getTypeArguments
in interface BeanDefinition<T>
type
- The super class or interface type@NonNull public final List<Argument<?>> getTypeArguments()
BeanDefinition
getTypeArguments
in interface BeanDefinition<T>
public AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
public Qualifier<T> getDeclaredQualifier()
BeanDefinition
getDeclaredQualifier
in interface BeanDefinition<T>