Definition Type: Element
Name: constructor-arg
Namespace: http://www.springframework.org/schema/beans
Containing Schema: spring-beans-3.1.xsd
Abstract
Documentation:
Bean definitions can specify zero or more constructor arguments. This is an alternative to "autowire constructor". Arguments correspond to either a specific index of the constructor argument list or are supposed to be matched generically by type. Note: A single generic argument value will just be used once, rather than potentially matched multiple times (as of Spring 1.1). constructor-arg elements are also used in conjunction with the factory-method element to construct beans using static or instance factory methods.
Collapse XSD Schema Diagram:
Drilldown into props in schema spring-beans-3_1_xsd Drilldown into map in schema spring-beans-3_1_xsd Drilldown into set in schema spring-beans-3_1_xsd Drilldown into list in schema spring-beans-3_1_xsd Drilldown into array in schema spring-beans-3_1_xsd Drilldown into null in schema spring-beans-3_1_xsd Drilldown into value in schema spring-beans-3_1_xsd Drilldown into idref in schema spring-beans-3_1_xsd Drilldown into ref in schema spring-beans-3_1_xsd Drilldown into bean in schema spring-beans-3_1_xsd Drilldown into description in schema spring-beans-3_1_xsd Drilldown into value in schema spring-beans-3_1_xsd Drilldown into ref in schema spring-beans-3_1_xsd Drilldown into name in schema spring-beans-3_1_xsd Drilldown into type in schema spring-beans-3_1_xsd Drilldown into index in schema spring-beans-3_1_xsdXSD Diagram of constructor-arg in schema spring-beans-3_1_xsd (Membrane Service Proxy)
Collapse XSD Schema Code:
<xsd:element name="constructor-arg">
    <xsd:annotation>
        <xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues"><![CDATA[
	Bean definitions can specify zero or more constructor arguments.
	This is an alternative to "autowire constructor".
	Arguments correspond to either a specific index of the constructor
	argument list or are supposed to be matched generically by type.

	Note: A single generic argument value will just be used once, rather
	than potentially matched multiple times (as of Spring 1.1).

	constructor-arg elements are also used in conjunction with the
	factory-method element to construct beans using static or instance
	factory methods.
			]]></xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element ref="description" minOccurs="0" />
            <xsd:choice minOccurs="0" maxOccurs="1">
                <xsd:element ref="bean" />
                <xsd:element ref="ref" />
                <xsd:element ref="idref" />
                <xsd:element ref="value" />
                <xsd:element ref="null" />
                <xsd:element ref="array" />
                <xsd:element ref="list" />
                <xsd:element ref="set" />
                <xsd:element ref="map" />
                <xsd:element ref="props" />
                <xsd:any namespace="##other" processContents="strict" />
            </xsd:choice>
        </xsd:sequence>
        <xsd:attribute name="index" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation><![CDATA[
	The exact index of the argument in the constructor argument list.
	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
	the exact same type.
					]]></xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="type" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation><![CDATA[
	The exact type of the constructor argument. Only needed to avoid
	ambiguities, e.g. in case of 2 single argument constructors
	that can both be converted from a String.
					]]></xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="name" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation><![CDATA[
	The exact name of the argument in the constructor argument list.
	Only needed to avoid ambiguities, e.g. in case of 2 arguments of
	the exact same type. Note: This requires debug symbols to be
	stored in the class file in order to introspect argument names!
					]]></xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="ref" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation><![CDATA[
	A short-cut alternative to a nested "<ref bean='...'/>" element.
					]]></xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="value" type="xsd:string">
            <xsd:annotation>
                <xsd:documentation><![CDATA[
	A short-cut alternative to a nested "<value>...<value/>" element.
					]]></xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:complexType>
</xsd:element>
Collapse Child Elements:
Name Type Min Occurs Max Occurs
description beans:description 0 (1)
bean beans:bean (1) (1)
ref beans:ref (1) (1)
idref beans:idref (1) (1)
value beans:value (1) (1)
null beans:null (1) (1)
array beans:array (1) (1)
list beans:list (1) (1)
set beans:set (1) (1)
map beans:map (1) (1)
props beans:props (1) (1)
<xs:any> Allowed namespace: '##other' (1) (1)
Collapse Child Attributes:
Name Type Default Value Use
index beans:index (Optional)
type beans:type (Optional)
name beans:name (Optional)
ref beans:ref (Optional)
value beans:value (Optional)