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

public Class BeanDefinitionDefaults

extends Object
Class Inheritance
Imports
org.springframework.lang.Nullable, org.springframework.util.StringUtils

A simple holder for BeanDefinition property defaults.
Authors
Mark Fisher, Juergen Hoeller
Since
2.5
See Also
AbstractBeanDefinition#applyDefaults

Field Summary

Modifier and TypeField and Description
private int
private int
private String
private String
private Boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getAutowireMode()

Return the default autowire mode.

public int
getDependencyCheck()

Return the default dependency check code.

public String
getDestroyMethodName()

Return the name of the default destroy method.

public String
getInitMethodName()

Return the name of the default initializer method.

public Boolean

Returns:

the lazy-init flag if explicitly set, or null otherwise
getLazyInit
()

Return whether beans should be lazily initialized by default, i.e. not eagerly instantiated on startup.

public boolean

Returns:

whether to apply lazy-init semantics (false by default)
isLazyInit
()

Return whether beans should be lazily initialized by default, i.e. not eagerly instantiated on startup.

public void
setAutowireMode(int
the autowire mode to set. Must be one of the constants defined in AbstractBeanDefinition.
autowireMode
)

Set the autowire mode.

public void
setDependencyCheck(int
the code to set. Must be one of the constants defined in AbstractBeanDefinition.
dependencyCheck
)

Set the dependency check code.

public void
setDestroyMethodName(String destroyMethodName)

Set the name of the default destroy method.

public void
setInitMethodName(String initMethodName)

Set the name of the default initializer method.

public void
setLazyInit(boolean lazyInit)

Set whether beans should be lazily initialized by default.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autowireModeback to summary
private int autowireMode
dependencyCheckback to summary
private int dependencyCheck
destroyMethodNameback to summary
private String destroyMethodName
Annotations
@Nullable
initMethodNameback to summary
private String initMethodName
Annotations
@Nullable
lazyInitback to summary
private Boolean lazyInit
Annotations
@Nullable

Constructor Detail

BeanDefinitionDefaultsback to summary
public BeanDefinitionDefaults()

Method Detail

getAutowireModeback to summary
public int getAutowireMode()

Return the default autowire mode.

getDependencyCheckback to summary
public int getDependencyCheck()

Return the default dependency check code.

getDestroyMethodNameback to summary
public String getDestroyMethodName()

Return the name of the default destroy method.

Annotations
@Nullable
getInitMethodNameback to summary
public String getInitMethodName()

Return the name of the default initializer method.

Annotations
@Nullable
getLazyInitback to summary
public Boolean getLazyInit()

Return whether beans should be lazily initialized by default, i.e. not eagerly instantiated on startup. Only applicable to singleton beans.

Returns:Boolean

the lazy-init flag if explicitly set, or null otherwise

Annotations
@Nullable
Since
5.2
isLazyInitback to summary
public boolean isLazyInit()

Return whether beans should be lazily initialized by default, i.e. not eagerly instantiated on startup. Only applicable to singleton beans.

Returns:boolean

whether to apply lazy-init semantics (false by default)

setAutowireModeback to summary
public void setAutowireMode(int autowireMode)

Set the autowire mode. This determines whether any automagical detection and setting of bean references will happen. Default is AUTOWIRE_NO which means there won't be convention-based autowiring by name or type (however, there may still be explicit annotation-driven autowiring).

Parameters
autowireMode:int

the autowire mode to set. Must be one of the constants defined in AbstractBeanDefinition.

See Also
AbstractBeanDefinition#setAutowireMode
setDependencyCheckback to summary
public void setDependencyCheck(int dependencyCheck)

Set the dependency check code.

Parameters
dependencyCheck:int

the code to set. Must be one of the constants defined in AbstractBeanDefinition.

See Also
AbstractBeanDefinition#setDependencyCheck
setDestroyMethodNameback to summary
public void setDestroyMethodName(String destroyMethodName)

Set the name of the default destroy method.

Note that this method is not enforced on all affected bean definitions but rather taken as an optional callback, to be invoked if actually present.

See Also
AbstractBeanDefinition#setDestroyMethodName, AbstractBeanDefinition#setEnforceDestroyMethod
setInitMethodNameback to summary
public void setInitMethodName(String initMethodName)

Set the name of the default initializer method.

Note that this method is not enforced on all affected bean definitions but rather taken as an optional callback, to be invoked if actually present.

See Also
AbstractBeanDefinition#setInitMethodName, AbstractBeanDefinition#setEnforceInitMethod
setLazyInitback to summary
public void setLazyInit(boolean lazyInit)

Set whether beans should be lazily initialized by default.

If false, the bean will get instantiated on startup by bean factories that perform eager initialization of singletons.

See Also
AbstractBeanDefinition#setLazyInit