Print
SpringTags

@spring.bean

Defines a Spring bean.

Unique false

Allowed locations

class method constructor field
true false false false
Parameter Required Allowed values Default value Array Token separator Description
id false Any value   no   ID for the bean. This should be unique within the spring configuration. Either this

property, or the "name" property must be specified for each bean.
name false Any value   no   Name for the bean. This property can be used in place of the "id" attribute, where

the name being used contains characters that would be invalid as an XML ID attribute.
autowire false byName, byType, constructor, auto-detect, no   no   Sets the autowiring mode for the bean. "byName" wires beans to properties by

matching the bean's name to the property name. "byType" wires beans to properties

by matching a bean's type to the property type. "constructor" wires beans through

a constructor's parameters by matching types. "auto-detect" allows Spring to

choose between "byType" and "constructor" as it sees fit. "no" indicates that

no auto-wiring should be performed on this bean.
dependency-check false simple, objects, all, none   no   Sets dependency checking rules on a bean. "none" indicates no dependency checking.

"simple" dependency checking includes primitives and String.

"objects" dependency checking includes collaborators (other beans).

"all" performs both "simple" and "objects" dependency checking.
description false Any value   no   Describes the bean.
destroy-method false Any value   no   The name of an method to be invoked on bean factory shutdown.
parent false Any value   no    
init-method false Any value   no   The name of an initialization method to be invoked upon bean instantiation.
lazy-init false true, false   no   If "true", Spring will instantiate this bean when it's needed, rather than at bean factory startup.
singleton false true, false   no   If "true", one shared instance of this bean will be returned with every call to getBean().

If "false" each call results in a new instance.

@spring.constructor-arg

Wires a bean constructor argument.

Unique false

Allowed locations

class method constructor field
false false true false
Parameter Required Allowed values Default value Array Token separator Description
ref false Any value   no   The id of another bean to wire to the constructor argument.
list false Any value   no   Comma-separated list of values to assign as a List to a

constructor argument of type java.util.List.
value false Any value   no   The value to assign to the constructor argument.

@spring.property

Declares a bean property. Can be used at the class level (in which case the "name" attribute

is required and references a javabean property on this class or a parent) or on the mutator of a

javabean property.

Unique false

Allowed locations

class method constructor field
true true false false
Parameter Required Allowed values Default value Array Token separator Description
name false Any value   no   The name of the property to be wired (only when used at the class level)
ref false Any value   no   The id of another bean to wire to the property.
value false Any value   no   The value to assign to the property.
list false Any value   no   Comma-separated list of values to assign as a List to a

property of type java.util.List.
Powered by Atlassian Confluence