element <constructor-arg> (global)
Namespace: |
|
Type: |
|
Content: |
|
Defined: |
|
Includes: |
|
Used: |
|
Content Model Diagram
XML Representation Summary |
<constructor-arg |
|
|
= |
xsd:string |
|
= |
xsd:string |
|
= |
xsd:string |
|
= |
xsd:string |
|
= |
xsd:string |
|
|
> |
|
|
</constructor-arg> |
Content model elements (11):
-
array,
bean,
description,
idref,
list,
map,
null,
props,
ref,
set,
value
Included in content model of elements (2):
-
Known Usage Locations
Annotation
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.
See: java:org.springframework.beans.factory.config.ConstructorArgumentValues
XML Source (w/o annotations (6); see within schema source)
<xsd:element name="constructor-arg"> <xsd:complexType> <xsd:sequence> <xsd:choice maxOccurs="1" minOccurs="0"> <xsd:element ref="bean"/> <xsd:element ref="idref"/> <xsd:element ref="value"/> <xsd:element ref="null"/> <xsd:element ref="array"/> <xsd:element ref="list"/> <xsd:element ref="props"/> <xsd:any namespace="##other" processContents="strict"/> </xsd:choice> </xsd:sequence> <xsd:attribute name="index" type="xsd:string"/> <xsd:attribute name="type" type="xsd:string"/> <xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="ref" type="xsd:string"/> <xsd:attribute name="value" type="xsd:string"/> </xsd:complexType> </xsd:element> |
Attribute Detail (all declarations; defined within this component only; 5/5) index -
Type: |
xsd:string, predefined |
Use: |
optional |
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.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="index" type="xsd:string"/> |
name -
Type: |
xsd:string, predefined |
Use: |
optional |
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!
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="name" type="xsd:string"/> |
ref -
Type: |
xsd:string, predefined |
Use: |
optional |
A short-cut alternative to a nested "<ref bean='...'/>" element.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="ref" type="xsd:string"/> |
type -
Type: |
xsd:string, predefined |
Use: |
optional |
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.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="type" type="xsd:string"/> |
value -
Type: |
xsd:string, predefined |
Use: |
optional |
A short-cut alternative to a nested "<value>...<value/>" element.
XML Source (w/o annotations (1); see within schema source)
<xsd:attribute name="value" type="xsd:string"/> |
Content Element Detail (all declarations; defined within this component only; 12/12) -
XML Source (see within schema source)
<xsd:element ref="array"/> |
-
XML Source (see within schema source)
<xsd:element ref="bean"/> |
-
XML Source (see within schema source)
-
Type: |
anonymous complexType (restriction of xsd:anyType), empty content |
XML Source (see within schema source)
<xsd:element ref="idref"/> |
-
XML Source (see within schema source)
<xsd:element ref="list"/> |
-
XML Source (see within schema source)
-
XML Source (see within schema source)
<xsd:element ref="null"/> |
-
XML Source (see within schema source)
<xsd:element ref="props"/> |
-
Type: |
anonymous complexType (restriction of xsd:anyType), empty content |
XML Source (see within schema source)
-
XML Source (see within schema source)
-
XML Source (see within schema source)
<xsd:element ref="value"/> |
{any element with non-schema namespace} -
XML Source (see within schema source)
<xsd:any namespace="##other" processContents="strict"/> |