Top Description Fields Constructors Methods
org.springframework.beans.factory.support

public Class RootBeanDefinition

extends AbstractBeanDefinition
Class Inheritance
Known Direct Subclasses
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.CreateFromClassBeanDefinition
Annotations
@SuppressWarnings:serial
Imports
java.lang.reflect.AnnotatedElement, .Constructor, .Executable, .Member, .Method, java.util.Collections, .LinkedHashSet, .Set, java.util.function.Supplier, org.springframework.beans.MutablePropertyValues, org.springframework.beans.factory.config.BeanDefinition, .BeanDefinitionHolder, .ConstructorArgumentValues, org.springframework.core.ResolvableType, org.springframework.lang.Nullable, org.springframework.util.Assert

A root bean definition represents the merged bean definition at runtime that backs a specific bean in a Spring BeanFactory. It might have been created from multiple original bean definitions that inherit from each other, e.g. GenericBeanDefinitions from XML declarations. A root bean definition is essentially the 'unified' bean definition view at runtime.

Root bean definitions may also be used for registering individual bean definitions in the configuration phase. This is particularly applicable for programmatic definitions derived from factory methods (e.g. @Bean methods) and instance suppliers (e.g. lambda expressions) which come with extra type metadata (see setTargetType(ResolvableType)/setResolvedFactoryMethod(Method)).

Note

The preferred choice for bean definitions derived from declarative sources (e.g. XML definitions) is the flexible GenericBeanDefinition variant. GenericBeanDefinition comes with the advantage that it allows for dynamically defining parent dependencies, not 'hard-coding' the role as a root bean definition, even supporting parent relationship changes in the bean post-processor phase.

Authors
Rod Johnson, Juergen Hoeller, Sam Brannen
See Also
GenericBeanDefinition, ChildBeanDefinition

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv volatile Boolean
beforeInstantiationResolved

Package-visible field that indicates a before-instantiation post-processor having kicked in.

pack-priv final Object
constructorArgumentLock

Common lock for the four constructor fields below.

pack-priv boolean
constructorArgumentsResolved

Package-visible field that marks the constructor arguments as resolved.

private BeanDefinitionHolder
private Set<Member>
private Set<String>
private Set<String>
pack-priv volatile ResolvableType
factoryMethodReturnType

Package-visible field for caching the return type of a generically typed factory method.

pack-priv volatile Method
factoryMethodToIntrospect

Package-visible field for caching a unique factory method candidate for introspection.

pack-priv volatile Boolean
isFactoryBean

Package-visible field for caching if the bean is a factory bean.

pack-priv boolean
pack-priv boolean
postProcessed

Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied.

pack-priv final Object
postProcessingLock

Common lock for the two post-processing fields below.

pack-priv Object[]
preparedConstructorArguments

Package-visible field for caching partly prepared constructor arguments.

private AnnotatedElement
pack-priv Object[]
resolvedConstructorArguments

Package-visible field for caching fully resolved constructor arguments.

pack-priv Executable
resolvedConstructorOrFactoryMethod

Package-visible field for caching the resolved constructor or factory method.

pack-priv volatile String
resolvedDestroyMethodName

Package-visible field for caching a resolved destroy method name (also for inferred).

pack-priv volatile Class<?>
resolvedTargetType

Package-visible field for caching the determined Class of a given bean definition.

pack-priv volatile boolean
stale

Determines if the definition needs to be re-merged.

pack-priv volatile ResolvableType
Inherited from org.springframework.beans.factory.support.AbstractBeanDefinition:
AUTOWIRE_AUTODETECTAUTOWIRE_BY_NAMEAUTOWIRE_BY_TYPEAUTOWIRE_CONSTRUCTORAUTOWIRE_NODEPENDENCY_CHECK_ALLDEPENDENCY_CHECK_NONEDEPENDENCY_CHECK_OBJECTSDEPENDENCY_CHECK_SIMPLEINFER_METHODORDER_ATTRIBUTEPREFERRED_CONSTRUCTORS_ATTRIBUTESCOPE_DEFAULT

Constructor Summary

AccessConstructor and Description
public
RootBeanDefinition()

Create a new RootBeanDefinition, to be configured through its bean properties and configuration methods.

public
RootBeanDefinition(Class<?>
the class of the bean to instantiate
beanClass
)

Create a new RootBeanDefinition for a singleton.

public
RootBeanDefinition(ResolvableType
the type of bean to instantiate
beanType
)

Deprecated since 6.0.11. as of 6.0.11, in favor of an extra setTargetType(ResolvableType) call
Create a new RootBeanDefinition for a singleton.
public <T>
RootBeanDefinition(Class<T>
the class of the bean to instantiate
beanClass
,
Supplier<T>
the supplier to construct a bean instance, as an alternative to a declaratively specified factory method
instanceSupplier
)

Create a new RootBeanDefinition for a singleton bean, constructing each instance through calling the given supplier (possibly a lambda or method reference).

public <T>
RootBeanDefinition(Class<T>
the class of the bean to instantiate
beanClass
,
String
the name of the corresponding scope
scope
,
Supplier<T>
the supplier to construct a bean instance, as an alternative to a declaratively specified factory method
instanceSupplier
)

Create a new RootBeanDefinition for a scoped bean, constructing each instance through calling the given supplier (possibly a lambda or method reference).

public
RootBeanDefinition(Class<?>
the class of the bean to instantiate
beanClass
,
int
by name or type, using the constants in this interface
autowireMode
,
boolean
whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)
dependencyCheck
)

Create a new RootBeanDefinition for a singleton, using the given autowire mode.

public
RootBeanDefinition(Class<?>
the class of the bean to instantiate
beanClass
,
ConstructorArgumentValues
the constructor argument values to apply
cargs
,
MutablePropertyValues
the property values to apply
pvs
)

Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

public
RootBeanDefinition(String
the name of the class to instantiate
beanClassName
)

Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

public
RootBeanDefinition(String
the name of the class to instantiate
beanClassName
,
ConstructorArgumentValues
the constructor argument values to apply
cargs
,
MutablePropertyValues
the property values to apply
pvs
)

Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

public
RootBeanDefinition(RootBeanDefinition
the original bean definition to copy from
original
)

Create a new RootBeanDefinition as deep copy of the given bean definition.

pack-priv
RootBeanDefinition(BeanDefinition
the original bean definition to copy from
original
)

Create a new RootBeanDefinition as deep copy of the given bean definition.

Method Summary

Modifier and TypeMethod and Description
public RootBeanDefinition
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.equals.

Indicates whether some other object is "equal to" this one.
public BeanDefinitionHolder
getDecoratedDefinition()

Return the target definition that is being decorated by this bean definition, if any.

public Set<Member>
getExternallyManagedConfigMembers()

Get all externally managed configuration methods and fields (as an immutable Set).

public Set<String>
getExternallyManagedDestroyMethods()

Get all externally managed destruction methods (as an immutable Set).

public Set<String>
getExternallyManagedInitMethods()

Get all externally managed initialization methods (as an immutable Set).

public String
getParentName()

Implements org.springframework.beans.factory.config.BeanDefinition.getParentName.

Return the name of the parent definition of this bean definition, if any.
public Constructor<?>[]

Returns:

one or more preferred constructors, or null if none (in which case the regular no-arg default constructor will be called)
getPreferredConstructors
()

Determine preferred constructors to use for default construction, if any.

public AnnotatedElement
getQualifiedElement()

Return the AnnotatedElement defining qualifiers, if any.

public ResolvableType
getResolvableType()

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.getResolvableType.

Implements org.springframework.beans.factory.config.BeanDefinition.getResolvableType.

Return a ResolvableType for this bean definition, either from runtime-cached type information or from configuration-time setTargetType(ResolvableType) or setBeanClass(Class), also considering resolved factory method definitions.
public Method

Returns:

the factory method, or null if not found or not resolved yet
getResolvedFactoryMethod
()

Return the resolved factory method as a Java Method object, if available.

public Class<?>
getTargetType()

Return the target type of this bean definition, if known (either specified in advance or resolved on first instantiation).

pack-priv boolean
hasAnyExternallyManagedDestroyMethod(String destroyMethod)

Determine if the given method name indicates an externally managed destruction method, regardless of method visibility.

pack-priv boolean
hasAnyExternallyManagedInitMethod(String initMethod)

Determine if the given method name indicates an externally managed initialization method, regardless of method visibility.

private static boolean
public boolean
isExternallyManagedConfigMember(Member configMember)

Determine if the given method or field is an externally managed configuration member.

public boolean
isExternallyManagedDestroyMethod(String destroyMethod)

Determine if the given method name indicates an externally managed destruction method.

public boolean
isExternallyManagedInitMethod(String initMethod)

Determine if the given method name indicates an externally managed initialization method.

public boolean
isFactoryMethod(Method candidate)

Check whether the given candidate qualifies as a factory method.

public void
markAsPostProcessed()

Mark this bean definition as post-processed, i.e. processed by MergedBeanDefinitionPostProcessor.

public void
registerExternallyManagedConfigMember(Member configMember)

Register an externally managed configuration method or field.

public void
registerExternallyManagedDestroyMethod(String destroyMethod)

Register an externally managed configuration destruction method — for example, a method annotated with JSR-250's jakarta.annotation.PreDestroy annotation.

public void
registerExternallyManagedInitMethod(String initMethod)

Register an externally managed configuration initialization method — for example, a method annotated with JSR-250's javax.annotation.PostConstruct or Jakarta's jakarta.annotation.PostConstruct annotation.

public void
resolveDestroyMethodIfNecessary()

Resolve the inferred destroy method if necessary.

public void
setDecoratedDefinition(BeanDefinitionHolder decoratedDefinition)

Register a target definition that is being decorated by this bean definition.

public void
setInstanceSupplier(Supplier<?> supplier)

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.setInstanceSupplier.

Specify a callback for creating an instance of the bean, as an alternative to a declaratively specified factory method.
public void
setNonUniqueFactoryMethodName(String name)

Specify a factory method name that refers to an overloaded method.

public void
setParentName(String parentName)

Implements org.springframework.beans.factory.config.BeanDefinition.setParentName.

Set the name of the parent definition of this bean definition, if any.
public void
setQualifiedElement(AnnotatedElement qualifiedElement)

Specify the AnnotatedElement defining qualifiers, to be used instead of the target class or factory method.

public void
setResolvedFactoryMethod(Method
the resolved factory method, or null to reset it
method
)

Set a resolved Java Method for the factory method on this bean definition.

public void
setTargetType(ResolvableType targetType)

Specify a generics-containing target type of this bean definition, if known in advance.

public void
setTargetType(Class<?> targetType)

Specify the target type of this bean definition, if known in advance.

public void
setUniqueFactoryMethodName(String name)

Specify a factory method name that refers to a non-overloaded method.

public String
toString()

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.toString.

Returns a string representation of the object.
Inherited from org.springframework.beans.factory.support.AbstractBeanDefinition:
addQualifierapplyDefaultsclonecopyQualifiersFromgetAutowireModegetBeanClassgetBeanClassNamegetConstructorArgumentValuesgetDependencyCheckgetDependsOngetDescriptiongetDestroyMethodNamegetDestroyMethodNamesgetFactoryBeanNamegetFactoryMethodNamegetInitMethodNamegetInitMethodNamesgetInstanceSuppliergetLazyInitgetMethodOverridesgetOriginatingBeanDefinitiongetPropertyValuesgetQualifiergetQualifiersgetResolvedAutowireModegetResourcegetResourceDescriptiongetRolegetScopehasBeanClasshasConstructorArgumentValueshashCodehasMethodOverrideshasPropertyValueshasQualifierisAbstractisAutowireCandidateisEnforceDestroyMethodisEnforceInitMethodisLazyInitisLenientConstructorResolutionisNonPublicAccessAllowedisPrimaryisPrototypeisSingletonisSyntheticoverrideFromprepareMethodOverrideprepareMethodOverridesresolveBeanClasssetAbstractsetAutowireCandidatesetAutowireModesetBeanClasssetBeanClassNamesetConstructorArgumentValuessetDependencyChecksetDependsOnsetDescriptionsetDestroyMethodNamesetDestroyMethodNamessetEnforceDestroyMethodsetEnforceInitMethodsetFactoryBeanNamesetFactoryMethodNamesetInitMethodNamesetInitMethodNamessetLazyInitsetLenientConstructorResolutionsetMethodOverridessetNonPublicAccessAllowedsetOriginatingBeanDefinitionsetPrimarysetPropertyValuessetResourcesetResourceDescriptionsetRolesetScopesetSyntheticvalidate

Field Detail

allowCachingback to summary
pack-priv boolean allowCaching
beforeInstantiationResolvedback to summary
pack-priv volatile Boolean beforeInstantiationResolved

Package-visible field that indicates a before-instantiation post-processor having kicked in.

Annotations
@Nullable
constructorArgumentLockback to summary
pack-priv final Object constructorArgumentLock

Common lock for the four constructor fields below.

constructorArgumentsResolvedback to summary
pack-priv boolean constructorArgumentsResolved

Package-visible field that marks the constructor arguments as resolved.

decoratedDefinitionback to summary
private BeanDefinitionHolder decoratedDefinition
Annotations
@Nullable
externallyManagedConfigMembersback to summary
private Set<Member> externallyManagedConfigMembers
Annotations
@Nullable
externallyManagedDestroyMethodsback to summary
private Set<String> externallyManagedDestroyMethods
Annotations
@Nullable
externallyManagedInitMethodsback to summary
private Set<String> externallyManagedInitMethods
Annotations
@Nullable
factoryMethodReturnTypeback to summary
pack-priv volatile ResolvableType factoryMethodReturnType

Package-visible field for caching the return type of a generically typed factory method.

Annotations
@Nullable
factoryMethodToIntrospectback to summary
pack-priv volatile Method factoryMethodToIntrospect

Package-visible field for caching a unique factory method candidate for introspection.

Annotations
@Nullable
isFactoryBeanback to summary
pack-priv volatile Boolean isFactoryBean

Package-visible field for caching if the bean is a factory bean.

Annotations
@Nullable
isFactoryMethodUniqueback to summary
pack-priv boolean isFactoryMethodUnique
postProcessedback to summary
pack-priv boolean postProcessed

Package-visible field that indicates MergedBeanDefinitionPostProcessor having been applied.

postProcessingLockback to summary
pack-priv final Object postProcessingLock

Common lock for the two post-processing fields below.

preparedConstructorArgumentsback to summary
pack-priv Object[] preparedConstructorArguments

Package-visible field for caching partly prepared constructor arguments.

Annotations
@Nullable
qualifiedElementback to summary
private AnnotatedElement qualifiedElement
Annotations
@Nullable
resolvedConstructorArgumentsback to summary
pack-priv Object[] resolvedConstructorArguments

Package-visible field for caching fully resolved constructor arguments.

Annotations
@Nullable
resolvedConstructorOrFactoryMethodback to summary
pack-priv Executable resolvedConstructorOrFactoryMethod

Package-visible field for caching the resolved constructor or factory method.

Annotations
@Nullable
resolvedDestroyMethodNameback to summary
pack-priv volatile String resolvedDestroyMethodName

Package-visible field for caching a resolved destroy method name (also for inferred).

Annotations
@Nullable
resolvedTargetTypeback to summary
pack-priv volatile Class<?> resolvedTargetType

Package-visible field for caching the determined Class of a given bean definition.

Annotations
@Nullable
staleback to summary
pack-priv volatile boolean stale

Determines if the definition needs to be re-merged.

targetTypeback to summary
pack-priv volatile ResolvableType targetType
Annotations
@Nullable

Constructor Detail

RootBeanDefinitionback to summary
public RootBeanDefinition()

Create a new RootBeanDefinition, to be configured through its bean properties and configuration methods.

See Also
setBeanClass, setScope, setConstructorArgumentValues, setPropertyValues
RootBeanDefinitionback to summary
public RootBeanDefinition(Class<?> beanClass)

Create a new RootBeanDefinition for a singleton.

Parameters
beanClass:Class<?>

the class of the bean to instantiate

See Also
setBeanClass
RootBeanDefinitionback to summary
public RootBeanDefinition(ResolvableType beanType)

Deprecated

since 6.0.11.

as of 6.0.11, in favor of an extra setTargetType(ResolvableType) call

Create a new RootBeanDefinition for a singleton.

Parameters
beanType:ResolvableType

the type of bean to instantiate

Annotations
@Deprecated
since:6.0.11
Since
6.0
See Also
setTargetType(ResolvableType)
RootBeanDefinitionback to summary
public <T> RootBeanDefinition(Class<T> beanClass, Supplier<T> instanceSupplier)

Create a new RootBeanDefinition for a singleton bean, constructing each instance through calling the given supplier (possibly a lambda or method reference).

Parameters
beanClass:Class<T>

the class of the bean to instantiate

instanceSupplier:Supplier<T>

the supplier to construct a bean instance, as an alternative to a declaratively specified factory method

Since
5.0
See Also
setInstanceSupplier
RootBeanDefinitionback to summary
public <T> RootBeanDefinition(Class<T> beanClass, String scope, Supplier<T> instanceSupplier)

Create a new RootBeanDefinition for a scoped bean, constructing each instance through calling the given supplier (possibly a lambda or method reference).

Parameters
beanClass:Class<T>

the class of the bean to instantiate

scope:String

the name of the corresponding scope

instanceSupplier:Supplier<T>

the supplier to construct a bean instance, as an alternative to a declaratively specified factory method

Since
5.0
See Also
setInstanceSupplier
RootBeanDefinitionback to summary
public RootBeanDefinition(Class<?> beanClass, int autowireMode, boolean dependencyCheck)

Create a new RootBeanDefinition for a singleton, using the given autowire mode.

Parameters
beanClass:Class<?>

the class of the bean to instantiate

autowireMode:int

by name or type, using the constants in this interface

dependencyCheck:boolean

whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)

RootBeanDefinitionback to summary
public RootBeanDefinition(Class<?> beanClass, ConstructorArgumentValues cargs, MutablePropertyValues pvs)

Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Parameters
beanClass:Class<?>

the class of the bean to instantiate

cargs:ConstructorArgumentValues

the constructor argument values to apply

pvs:MutablePropertyValues

the property values to apply

RootBeanDefinitionback to summary
public RootBeanDefinition(String beanClassName)

Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Takes a bean class name to avoid eager loading of the bean class.

Parameters
beanClassName:String

the name of the class to instantiate

RootBeanDefinitionback to summary
public RootBeanDefinition(String beanClassName, ConstructorArgumentValues cargs, MutablePropertyValues pvs)

Create a new RootBeanDefinition for a singleton, providing constructor arguments and property values.

Takes a bean class name to avoid eager loading of the bean class.

Parameters
beanClassName:String

the name of the class to instantiate

cargs:ConstructorArgumentValues

the constructor argument values to apply

pvs:MutablePropertyValues

the property values to apply

RootBeanDefinitionback to summary
public RootBeanDefinition(RootBeanDefinition original)

Create a new RootBeanDefinition as deep copy of the given bean definition.

Parameters
original:RootBeanDefinition

the original bean definition to copy from

RootBeanDefinitionback to summary
pack-priv RootBeanDefinition(BeanDefinition original)

Create a new RootBeanDefinition as deep copy of the given bean definition.

Parameters
original:BeanDefinition

the original bean definition to copy from

Method Detail

cloneBeanDefinitionback to summary
public RootBeanDefinition cloneBeanDefinition()

Implements abstract org.springframework.beans.factory.support.AbstractBeanDefinition.cloneBeanDefinition.

Doc from org.springframework.beans.factory.support.AbstractBeanDefinition.cloneBeanDefinition.

Clone this bean definition. To be implemented by concrete subclasses.

Returns:RootBeanDefinition

the cloned bean definition object

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getDecoratedDefinitionback to summary
public BeanDefinitionHolder getDecoratedDefinition()

Return the target definition that is being decorated by this bean definition, if any.

Annotations
@Nullable
getExternallyManagedConfigMembersback to summary
public Set<Member> getExternallyManagedConfigMembers()

Get all externally managed configuration methods and fields (as an immutable Set).

Since
5.3.11
getExternallyManagedDestroyMethodsback to summary
public Set<String> getExternallyManagedDestroyMethods()

Get all externally managed destruction methods (as an immutable Set).

See registerExternallyManagedDestroyMethod for details regarding the format for the destruction methods in the returned set.

Since
5.3.11
getExternallyManagedInitMethodsback to summary
public Set<String> getExternallyManagedInitMethods()

Get all externally managed initialization methods (as an immutable Set).

See registerExternallyManagedInitMethod for details regarding the format for the initialization methods in the returned set.

Since
5.3.11
getParentNameback to summary
public String getParentName()

Implements org.springframework.beans.factory.config.BeanDefinition.getParentName.

Doc from org.springframework.beans.factory.config.BeanDefinition.getParentName.

Return the name of the parent definition of this bean definition, if any.

Annotations
@Override
getPreferredConstructorsback to summary
public Constructor<?>[] getPreferredConstructors()

Determine preferred constructors to use for default construction, if any. Constructor arguments will be autowired if necessary.

As of 6.1, the default implementation of this method takes the PREFERRED_CONSTRUCTORS_ATTRIBUTE attribute into account. Subclasses are encouraged to preserve this through a super call, either before or after their own preferred constructor determination.

Returns:Constructor<?>[]

one or more preferred constructors, or null if none (in which case the regular no-arg default constructor will be called)

Annotations
@Nullable
Since
5.1
getQualifiedElementback to summary
public AnnotatedElement getQualifiedElement()

Return the AnnotatedElement defining qualifiers, if any. Otherwise, the factory method and target class will be checked.

Annotations
@Nullable
Since
4.3.3
getResolvableTypeback to summary
public ResolvableType getResolvableType()

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.getResolvableType.

Implements org.springframework.beans.factory.config.BeanDefinition.getResolvableType.

Return a ResolvableType for this bean definition, either from runtime-cached type information or from configuration-time setTargetType(ResolvableType) or setBeanClass(Class), also considering resolved factory method definitions.

Returns:ResolvableType

Doc from org.springframework.beans.factory.config.BeanDefinition.getResolvableType.

the resolvable type (potentially ResolvableType#NONE)

Annotations
@Override
Since
5.1
See Also
setTargetType(ResolvableType), setBeanClass(Class), setResolvedFactoryMethod(Method)
getResolvedFactoryMethodback to summary
public Method getResolvedFactoryMethod()

Return the resolved factory method as a Java Method object, if available.

Returns:Method

the factory method, or null if not found or not resolved yet

Annotations
@Nullable
getTargetTypeback to summary
public Class<?> getTargetType()

Return the target type of this bean definition, if known (either specified in advance or resolved on first instantiation).

Annotations
@Nullable
Since
3.2.2
hasAnyExternallyManagedDestroyMethodback to summary
pack-priv boolean hasAnyExternallyManagedDestroyMethod(String destroyMethod)

Determine if the given method name indicates an externally managed destruction method, regardless of method visibility.

In contrast to isExternallyManagedDestroyMethod(String), this method also returns true if there is a private externally managed destruction method that has been registered using a qualified method name instead of a simple method name.

Since
5.3.17
hasAnyExternallyManagedInitMethodback to summary
pack-priv boolean hasAnyExternallyManagedInitMethod(String initMethod)

Determine if the given method name indicates an externally managed initialization method, regardless of method visibility.

In contrast to isExternallyManagedInitMethod(String), this method also returns true if there is a private externally managed initialization method that has been registered using a qualified method name instead of a simple method name.

Since
5.3.17
hasAnyExternallyManagedMethodback to summary
private static boolean hasAnyExternallyManagedMethod(Set<String> candidates, String methodName)
isExternallyManagedConfigMemberback to summary
public boolean isExternallyManagedConfigMember(Member configMember)

Determine if the given method or field is an externally managed configuration member.

isExternallyManagedDestroyMethodback to summary
public boolean isExternallyManagedDestroyMethod(String destroyMethod)

Determine if the given method name indicates an externally managed destruction method.

See registerExternallyManagedDestroyMethod for details regarding the format for the supplied destroyMethod.

isExternallyManagedInitMethodback to summary
public boolean isExternallyManagedInitMethod(String initMethod)

Determine if the given method name indicates an externally managed initialization method.

See registerExternallyManagedInitMethod for details regarding the format for the supplied initMethod.

isFactoryMethodback to summary
public boolean isFactoryMethod(Method candidate)

Check whether the given candidate qualifies as a factory method.

markAsPostProcessedback to summary
public void markAsPostProcessed()

Mark this bean definition as post-processed, i.e. processed by MergedBeanDefinitionPostProcessor.

Since
6.0
registerExternallyManagedConfigMemberback to summary
public void registerExternallyManagedConfigMember(Member configMember)

Register an externally managed configuration method or field.

registerExternallyManagedDestroyMethodback to summary
public void registerExternallyManagedDestroyMethod(String destroyMethod)

Register an externally managed configuration destruction method — for example, a method annotated with JSR-250's jakarta.annotation.PreDestroy annotation.

The supplied destroyMethod may be the simple method name for non-private methods or the qualified method name for private methods. A qualified name is necessary for private methods in order to disambiguate between multiple private methods with the same name within a class hierarchy.

registerExternallyManagedInitMethodback to summary
public void registerExternallyManagedInitMethod(String initMethod)

Register an externally managed configuration initialization method — for example, a method annotated with JSR-250's javax.annotation.PostConstruct or Jakarta's jakarta.annotation.PostConstruct annotation.

The supplied initMethod may be a simple method name or a qualified method name for package-private and private methods. A qualified name is necessary for package-private and private methods in order to disambiguate between multiple such methods with the same name within a type hierarchy.

resolveDestroyMethodIfNecessaryback to summary
public void resolveDestroyMethodIfNecessary()

Resolve the inferred destroy method if necessary.

Since
6.0
setDecoratedDefinitionback to summary
public void setDecoratedDefinition(BeanDefinitionHolder decoratedDefinition)

Register a target definition that is being decorated by this bean definition.

setInstanceSupplierback to summary
public void setInstanceSupplier(Supplier<?> supplier)

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.setInstanceSupplier.

Doc from org.springframework.beans.factory.support.AbstractBeanDefinition.setInstanceSupplier.

Specify a callback for creating an instance of the bean, as an alternative to a declaratively specified factory method.

If such a callback is set, it will override any other constructor or factory method metadata. However, bean property population and potential annotation-driven injection will still apply as usual.

Annotations
@Override
setNonUniqueFactoryMethodNameback to summary
public void setNonUniqueFactoryMethodName(String name)

Specify a factory method name that refers to an overloaded method.

Since
5.2
setParentNameback to summary
public void setParentName(String parentName)

Implements org.springframework.beans.factory.config.BeanDefinition.setParentName.

Doc from org.springframework.beans.factory.config.BeanDefinition.setParentName.

Set the name of the parent definition of this bean definition, if any.

Annotations
@Override
setQualifiedElementback to summary
public void setQualifiedElement(AnnotatedElement qualifiedElement)

Specify the AnnotatedElement defining qualifiers, to be used instead of the target class or factory method.

Since
4.3.3
See Also
setTargetType(ResolvableType), getResolvedFactoryMethod()
setResolvedFactoryMethodback to summary
public void setResolvedFactoryMethod(Method method)

Set a resolved Java Method for the factory method on this bean definition.

Parameters
method:Method

the resolved factory method, or null to reset it

Since
5.2
setTargetTypeback to summary
public void setTargetType(ResolvableType targetType)

Specify a generics-containing target type of this bean definition, if known in advance.

Since
4.3.3
setTargetTypeback to summary
public void setTargetType(Class<?> targetType)

Specify the target type of this bean definition, if known in advance.

Since
3.2.2
setUniqueFactoryMethodNameback to summary
public void setUniqueFactoryMethodName(String name)

Specify a factory method name that refers to a non-overloaded method.

toStringback to summary
public String toString()

Overrides org.springframework.beans.factory.support.AbstractBeanDefinition.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override