@Internal public abstract class AbstractBeanResolutionContext extends Object implements BeanResolutionContext
BeanResolutionContext interface.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBeanResolutionContext.AnnotationSegment
A segment that represents annotation.
|
static class |
AbstractBeanResolutionContext.ConstructorArgumentSegment
A segment that represents a method argument.
|
static class |
AbstractBeanResolutionContext.ConstructorSegment
A segment that represents a constructor.
|
static class |
AbstractBeanResolutionContext.FieldSegment
A segment that represents a field.
|
static class |
AbstractBeanResolutionContext.MethodArgumentSegment
A segment that represents a method argument.
|
static class |
AbstractBeanResolutionContext.MethodSegment
A segment that represents a method.
|
BeanResolutionContext.Path, BeanResolutionContext.Segment<T>| Modifier and Type | Field and Description |
|---|---|
protected DefaultBeanContext |
context |
protected BeanResolutionContext.Path |
path |
protected BeanDefinition<?> |
rootDefinition |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBeanResolutionContext(DefaultBeanContext context,
BeanDefinition<?> rootDefinition) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addDependentBean(BeanRegistration<T> beanRegistration)
Adds a dependent bean to the resolution context.
|
void |
copyStateFrom(AbstractBeanResolutionContext context)
Copy the state from a previous resolution context.
|
void |
destroyInjectScopedBeans()
Call back to destroy any
InjectScope beans. |
<T> Optional<T> |
findBean(Argument<T> beanType,
Qualifier<T> qualifier)
Find an optional bean of the given type and qualifier.
|
<T> Optional<T> |
get(CharSequence name,
ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name.
|
<T> Optional<T> |
get(CharSequence name,
Class<T> requiredType)
Resolve the given property for the given name.
|
List<BeanRegistration<?>> |
getAndResetDependentBeans() |
BeanRegistration<?> |
getAndResetDependentFactoryBean() |
Object |
getAttribute(CharSequence key) |
<T> T |
getBean(Argument<T> beanType,
Qualifier<T> qualifier)
Get a bean of the given type and qualifier.
|
<T> Collection<BeanRegistration<T>> |
getBeanRegistrations(Argument<T> beanType,
Qualifier<T> qualifier)
Obtains the bean registrations for the given type and qualifier.
|
<T> Collection<T> |
getBeansOfType(Argument<T> beanType,
Qualifier<T> qualifier)
Get all beans of the given type and qualifier.
|
BeanContext |
getContext() |
Qualifier<?> |
getCurrentQualifier() |
BeanResolutionContext.Path |
getPath() |
BeanDefinition |
getRootDefinition() |
<T> T |
inject(BeanDefinition<?> beanDefinition,
T instance)
Injects a bean.
|
void |
markDependentAsFactory()
Marks first dependent as factory.
|
protected void |
onNewSegment(BeanResolutionContext.Segment<?> segment) |
List<BeanRegistration<?>> |
popDependentBeans() |
void |
pushDependentBeans(List<BeanRegistration<?>> dependentBeans)
The push the current dependent beans that must be destroyed by an upstream bean.
|
Object |
removeAttribute(CharSequence key)
Remove the attribute for the given key.
|
Object |
setAttribute(CharSequence key,
Object value)
Store a value within the context.
|
void |
setCurrentQualifier(Qualifier<?> qualifier)
Sets the current qualifier.
|
<T> Stream<T> |
streamOfType(Argument<T> beanType,
Qualifier<T> qualifier)
Obtains a stream of beans of the given type and qualifier.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddInFlightBean, close, copy, getInFlightBean, removeInFlightBeanget, getprotected final DefaultBeanContext context
protected final BeanDefinition<?> rootDefinition
protected final BeanResolutionContext.Path path
@Internal protected AbstractBeanResolutionContext(DefaultBeanContext context, BeanDefinition<?> rootDefinition)
context - The bean contextrootDefinition - The bean root definition@NonNull public <T> T getBean(@NonNull Argument<T> beanType, @Nullable Qualifier<T> qualifier)
BeanResolutionContextgetBean in interface BeanResolutionContextT - The bean type parameterbeanType - The bean typequalifier - The qualifier@NonNull public <T> Collection<T> getBeansOfType(@NonNull Argument<T> beanType, @Nullable Qualifier<T> qualifier)
BeanResolutionContextgetBeansOfType in interface BeanResolutionContextT - The bean type parameterbeanType - The bean typequalifier - The qualifier@NonNull public <T> Stream<T> streamOfType(@NonNull Argument<T> beanType, @Nullable Qualifier<T> qualifier)
BeanResolutionContextstreamOfType in interface BeanResolutionContextT - The bean concrete typebeanType - The bean typequalifier - The qualifier@NonNull public <T> Optional<T> findBean(@NonNull Argument<T> beanType, @Nullable Qualifier<T> qualifier)
BeanResolutionContextfindBean in interface BeanResolutionContextT - The bean type parameterbeanType - The bean typequalifier - The qualifierOptional@NonNull public <T> T inject(@Nullable BeanDefinition<?> beanDefinition, @NonNull T instance)
BeanResolutionContextinject in interface BeanResolutionContextT - The instance typebeanDefinition - The requesting bean definitioninstance - The instance@NonNull public <T> Collection<BeanRegistration<T>> getBeanRegistrations(@NonNull Argument<T> beanType, @Nullable Qualifier<T> qualifier)
BeanResolutionContextgetBeanRegistrations in interface BeanResolutionContextT - The generic typebeanType - The bean typequalifier - The qualifierBeanRegistrationpublic void copyStateFrom(@NonNull AbstractBeanResolutionContext context)
context - The previous contextpublic <T> void addDependentBean(BeanRegistration<T> beanRegistration)
BeanResolutionContextaddDependentBean in interface BeanResolutionContextT - The generic typebeanRegistration - The bean registrationpublic void destroyInjectScopedBeans()
BeanResolutionContextInjectScope beans.destroyInjectScopedBeans in interface BeanResolutionContextInjectScope@NonNull public List<BeanRegistration<?>> getAndResetDependentBeans()
getAndResetDependentBeans in interface BeanResolutionContextpublic void markDependentAsFactory()
BeanResolutionContextmarkDependentAsFactory in interface BeanResolutionContextpublic BeanRegistration<?> getAndResetDependentFactoryBean()
getAndResetDependentFactoryBean in interface BeanResolutionContextpublic List<BeanRegistration<?>> popDependentBeans()
popDependentBeans in interface BeanResolutionContextpublic void pushDependentBeans(List<BeanRegistration<?>> dependentBeans)
BeanResolutionContextpushDependentBeans in interface BeanResolutionContextdependentBeans - Dependent beans collection that can be used to add more dependentspublic final BeanContext getContext()
getContext in interface BeanResolutionContextpublic final BeanDefinition getRootDefinition()
getRootDefinition in interface BeanResolutionContextpublic final BeanResolutionContext.Path getPath()
getPath in interface BeanResolutionContextpublic final Object setAttribute(CharSequence key, Object value)
BeanResolutionContextsetAttribute in interface BeanResolutionContextkey - The keyvalue - The valuepublic final Object getAttribute(CharSequence key)
getAttribute in interface BeanResolutionContextkey - The keypublic final Object removeAttribute(CharSequence key)
BeanResolutionContextremoveAttribute in interface BeanResolutionContextkey - the key@Nullable public Qualifier<?> getCurrentQualifier()
getCurrentQualifier in interface BeanResolutionContextpublic void setCurrentQualifier(@Nullable Qualifier<?> qualifier)
BeanResolutionContextsetCurrentQualifier in interface BeanResolutionContextqualifier - The qualifierpublic <T> Optional<T> get(CharSequence name, ArgumentConversionContext<T> conversionContext)
ValueResolverget in interface ValueResolver<CharSequence>T - The concrete typename - The nameconversionContext - The conversion contextpublic <T> Optional<T> get(CharSequence name, Class<T> requiredType)
ValueResolverget in interface ValueResolver<CharSequence>T - The concrete typename - The namerequiredType - The required typeprotected void onNewSegment(BeanResolutionContext.Segment<?> segment)