1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
3 <xsd:schema xmlns="http://www.springframework.org/schema/beans"
4 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5 targetNamespace="http://www.springframework.org/schema/beans">
7 <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
10 <xsd:documentation><![CDATA[
11 Spring XML Beans Schema, version 3.1
12 Authors: Juergen Hoeller, Rob Harrop, Mark Fisher, Chris Beams
14 This defines a simple and consistent way of creating a namespace
15 of JavaBeans objects, managed by a Spring BeanFactory, read by
16 XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader).
18 This document type is used by most Spring functionality, including
19 web application contexts, which are based on bean factories.
21 Each "bean" element in this document defines a JavaBean.
22 Typically the bean class is specified, along with JavaBean properties
23 and/or constructor arguments.
25 A bean instance can be a "singleton" (shared instance) or a "prototype"
26 (independent instance). Further scopes can be provided by extended
27 bean factories, for example in a web environment.
29 References among beans are supported, that is, setting a JavaBean property
30 or a constructor argument to refer to another bean in the same factory
31 (or an ancestor factory).
33 As alternative to bean references, "inner bean definitions" can be used.
34 Singleton flags of such inner bean definitions are effectively ignored:
35 inner beans are typically anonymous prototypes.
37 There is also support for lists, sets, maps, and java.util.Properties
38 as bean property types or constructor argument types.
39 ]]></xsd:documentation>
43 <xsd:complexType name="identifiedType" abstract="true">
45 <xsd:documentation><![CDATA[
46 The unique identifier for a bean. The scope of the identifier
47 is the enclosing bean factory.
48 ]]></xsd:documentation>
50 <xsd:attribute name="id" type="xsd:string">
52 <xsd:documentation><![CDATA[
53 The unique identifier for a bean. A bean id may not be used more than once
54 within the same <beans> element.
55 ]]></xsd:documentation>
60 <!-- Top-level <beans> tag -->
61 <xsd:element name="beans">
63 <xsd:documentation><![CDATA[
64 Container for <bean> and other elements, typically the root element in the document.
65 Allows the definition of default values for all nested bean definitions. May itself
66 be nested for the purpose of defining a subset of beans with certain default values or
67 to be registered only when certain profile(s) are active. Any such nested <beans> element
68 must be declared as the last element in the document.
69 ]]></xsd:documentation>
73 <xsd:element ref="description" minOccurs="0"/>
74 <xsd:choice minOccurs="0" maxOccurs="unbounded">
75 <xsd:element ref="import"/>
76 <xsd:element ref="alias"/>
77 <xsd:element ref="bean"/>
78 <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
80 <xsd:element ref="beans" minOccurs="0" maxOccurs="unbounded"/>
82 <xsd:attribute name="profile" use="optional" type="xsd:string">
84 <xsd:documentation><![CDATA[
85 The set of profiles for which this <beans> element may be parsed. Multiple profiles can be
86 separated by any number of spaces, commas, or semi-colons (or indeed any mixture of the three).
87 If one or more of the specified profiles are active at time of parsing, the <beans> element
88 will be parsed, and all of its <bean> elements registered, <import> elements followed,
89 etc. If none of the specified profiles are active at time of parsing, then the entire element
90 and its contents will be ignored.
92 Profiles are activated in one of two ways:
94 ConfigurableEnvironment#setActiveProfiles(String...)
95 ConfigurableEnvironment#setDefaultProfiles(String...)
97 Properties (typically through -D system properties, environment variables, or servlet context init params):
98 spring.profiles.active=p1,p2
99 spring.profiles.default=p1,p2
100 ]]></xsd:documentation>
103 <xsd:attribute name="default-lazy-init" default="default" type="defaultable-boolean">
105 <xsd:documentation><![CDATA[
106 The default 'lazy-init' value; see the documentation for the
107 'lazy-init' attribute of the 'bean' element.
108 ]]></xsd:documentation>
111 <xsd:attribute name="default-merge" default="default" type="defaultable-boolean">
113 <xsd:documentation><![CDATA[
114 The default 'merge' value; see the documentation for the
115 'merge' attribute of the various collection elements. The default
117 ]]></xsd:documentation>
120 <xsd:attribute name="default-autowire" default="default">
122 <xsd:documentation><![CDATA[
123 The default 'autowire' value; see the documentation for the
124 'autowire' attribute of the 'bean' element. The default is 'default'.
125 ]]></xsd:documentation>
128 <xsd:restriction base="xsd:NMTOKEN">
129 <xsd:enumeration value="default"/>
130 <xsd:enumeration value="no"/>
131 <xsd:enumeration value="byName"/>
132 <xsd:enumeration value="byType"/>
133 <xsd:enumeration value="constructor"/>
137 <xsd:attribute name="default-autowire-candidates" type="xsd:string">
139 <xsd:documentation><![CDATA[
140 A default bean name pattern for identifying autowire candidates:
141 e.g. "*Service", "data*", "*Service*", "data*Service".
142 Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao".
143 See the documentation for the 'autowire-candidate' attribute of the
144 'bean' element for the semantic details of autowire candidate beans.
145 ]]></xsd:documentation>
148 <xsd:attribute name="default-init-method" type="xsd:string">
150 <xsd:documentation><![CDATA[
151 The default 'init-method' value; see the documentation for the
152 'init-method' attribute of the 'bean' element.
153 ]]></xsd:documentation>
156 <xsd:attribute name="default-destroy-method" type="xsd:string">
158 <xsd:documentation><![CDATA[
159 The default 'destroy-method' value; see the documentation for the
160 'destroy-method' attribute of the 'bean' element.
161 ]]></xsd:documentation>
164 <xsd:anyAttribute namespace="##other" processContents="lax"/>
168 <xsd:element name="description">
170 <xsd:documentation><![CDATA[
171 Contains informative text describing the purpose of the enclosing element.
172 Used primarily for user documentation of XML bean definition documents.
173 ]]></xsd:documentation>
175 <xsd:complexType mixed="true">
176 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
180 <xsd:element name="import">
182 <xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
183 Specifies an XML bean definition resource to import.
184 ]]></xsd:documentation>
188 <xsd:restriction base="xsd:anyType">
189 <xsd:attribute name="resource" type="xsd:string" use="required">
191 <xsd:documentation><![CDATA[
192 The relative resource location of the XML (bean definition) file to import,
193 for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
194 ]]></xsd:documentation>
198 </xsd:complexContent>
202 <xsd:element name="alias">
204 <xsd:documentation><![CDATA[
205 Defines an alias for a bean (which can reside in a different definition
207 ]]></xsd:documentation>
211 <xsd:restriction base="xsd:anyType">
212 <xsd:attribute name="name" type="xsd:string" use="required">
214 <xsd:documentation><![CDATA[
215 The name of the bean to define an alias for.
216 ]]></xsd:documentation>
219 <xsd:attribute name="alias" type="xsd:string" use="required">
221 <xsd:documentation><![CDATA[
222 The alias name to define for the bean.
223 ]]></xsd:documentation>
227 </xsd:complexContent>
231 <xsd:group name="beanElements">
233 <xsd:element ref="description" minOccurs="0"/>
234 <xsd:choice minOccurs="0" maxOccurs="unbounded">
235 <xsd:element ref="meta"/>
236 <xsd:element ref="constructor-arg"/>
237 <xsd:element ref="property"/>
238 <xsd:element ref="qualifier"/>
239 <xsd:element ref="lookup-method"/>
240 <xsd:element ref="replaced-method"/>
241 <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
246 <xsd:attributeGroup name="beanAttributes">
247 <xsd:attribute name="name" type="xsd:string">
249 <xsd:documentation><![CDATA[
250 Can be used to create one or more aliases illegal in an (XML) id.
251 Multiple aliases can be separated by any number of spaces, commas,
252 or semi-colons (or indeed any mixture of the three).
253 ]]></xsd:documentation>
256 <xsd:attribute name="class" type="xsd:string">
258 <xsd:documentation source="java:java.lang.Class"><![CDATA[
259 The fully qualified name of the bean's class, except if it serves only
260 as a parent definition for child bean definitions.
261 ]]></xsd:documentation>
264 <xsd:attribute name="parent" type="xsd:string">
266 <xsd:documentation><![CDATA[
267 The name of the parent bean definition.
269 Will use the bean class of the parent if none is specified, but can
270 also override it. In the latter case, the child bean class must be
271 compatible with the parent, i.e. accept the parent's property values
272 and constructor argument values, if any.
274 A child bean definition will inherit constructor argument values,
275 property values and method overrides from the parent, with the option
276 to add new values. If init method, destroy method, factory bean and/or
277 factory method are specified, they will override the corresponding
280 The remaining settings will always be taken from the child definition:
281 depends on, autowire mode, scope, lazy init.
282 ]]></xsd:documentation>
285 <xsd:attribute name="scope" type="xsd:string">
287 <xsd:documentation><![CDATA[
288 The scope of this bean: typically "singleton" (one shared instance,
289 which will be returned by all calls to getBean with the given id), or
290 "prototype" (independent instance resulting from each call to getBean).
292 By default, a bean will be a singleton, unless the bean has a parent
293 bean definition in which case it will inherit the parent's scope.
295 Singletons are most commonly used, and are ideal for multi-threaded
296 service objects. Further scopes, such as "request" or "session", might
297 be supported by extended bean factories (e.g. in a web environment).
299 Inner bean definitions inherit the singleton status of their containing
300 bean definition, unless explicitly specified: The inner bean will be a
301 singleton if the containing bean is a singleton, and a prototype if
302 the containing bean has any other scope.
303 ]]></xsd:documentation>
306 <xsd:attribute name="abstract" type="xsd:boolean">
308 <xsd:documentation><![CDATA[
309 Is this bean "abstract", that is, not meant to be instantiated itself
310 but rather just serving as parent for concrete child bean definitions?
311 The default is "false". Specify "true" to tell the bean factory to not
312 try to instantiate that particular bean in any case.
314 Note: This attribute will not be inherited by child bean definitions.
315 Hence, it needs to be specified per abstract bean definition.
316 ]]></xsd:documentation>
319 <xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
321 <xsd:documentation><![CDATA[
322 Indicates whether or not this bean is to be lazily initialized.
323 If false, it will be instantiated on startup by bean factories
324 that perform eager initialization of singletons. The default is
327 Note: This attribute will not be inherited by child bean definitions.
328 Hence, it needs to be specified per concrete bean definition.
329 ]]></xsd:documentation>
332 <xsd:attribute name="autowire" default="default">
334 <xsd:documentation><![CDATA[
335 Controls whether bean properties are "autowired".
336 This is an automagical process in which bean references don't need
337 to be coded explicitly in the XML bean definition file, but rather the
338 Spring container works out dependencies.
343 The traditional Spring default. No automagical wiring. Bean references
344 must be defined in the XML file via the <ref/> element (or "ref"
345 attribute). We recommend this in most cases as it makes documentation
348 Note that this default mode also allows for annotation-driven autowiring,
349 if activated. "no" refers to externally driven autowiring only, not
350 affecting any autowiring demands that the bean class itself expresses.
353 Autowiring by property name. If a bean of class Cat exposes a "dog"
354 property, Spring will try to set this to the value of the bean "dog"
355 in the current container. If there is no matching bean by name, nothing
359 Autowiring if there is exactly one bean of the property type in the
360 container. If there is more than one, a fatal error is raised, and
361 you cannot use byType autowiring for that bean. If there is none,
362 nothing special happens.
365 Analogous to "byType" for constructor arguments. If there is not exactly
366 one bean of the constructor argument type in the bean factory, a fatal
369 Note that explicit dependencies, i.e. "property" and "constructor-arg"
370 elements, always override autowiring.
372 Note: This attribute will not be inherited by child bean definitions.
373 Hence, it needs to be specified per concrete bean definition.
374 ]]></xsd:documentation>
377 <xsd:restriction base="xsd:NMTOKEN">
378 <xsd:enumeration value="default"/>
379 <xsd:enumeration value="no"/>
380 <xsd:enumeration value="byName"/>
381 <xsd:enumeration value="byType"/>
382 <xsd:enumeration value="constructor"/>
386 <xsd:attribute name="depends-on" type="xsd:string">
388 <xsd:documentation><![CDATA[
389 The names of the beans that this bean depends on being initialized.
390 The bean factory will guarantee that these beans get initialized
393 Note that dependencies are normally expressed through bean properties
394 or constructor arguments. This property should just be necessary for
395 other kinds of dependencies like statics (*ugh*) or database preparation
398 Note: This attribute will not be inherited by child bean definitions.
399 Hence, it needs to be specified per concrete bean definition.
400 ]]></xsd:documentation>
403 <xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean">
405 <xsd:documentation><![CDATA[
406 Indicates whether or not this bean should be considered when looking
407 for matching candidates to satisfy another bean's autowiring requirements.
408 Note that this does not affect explicit references by name, which will get
409 resolved even if the specified bean is not marked as an autowire candidate.
410 ]]></xsd:documentation>
413 <xsd:attribute name="primary" type="xsd:boolean">
415 <xsd:documentation><![CDATA[
416 Specifies that this bean should be given preference when multiple
417 candidates are qualified to autowire a single-valued dependency.
418 If exactly one 'primary' bean exists among the candidates, it
419 will be the autowired value.
420 ]]></xsd:documentation>
423 <xsd:attribute name="init-method" type="xsd:string">
425 <xsd:documentation><![CDATA[
426 The name of the custom initialization method to invoke after setting
427 bean properties. The method must have no arguments, but may throw any
429 ]]></xsd:documentation>
432 <xsd:attribute name="destroy-method" type="xsd:string">
434 <xsd:documentation><![CDATA[
435 The name of the custom destroy method to invoke on bean factory
436 shutdown. The method must have no arguments, but may throw any
439 Note: Only invoked on beans whose lifecycle is under the full
440 control of the factory - which is always the case for singletons,
441 but not guaranteed for any other scope.
442 ]]></xsd:documentation>
445 <xsd:attribute name="factory-method" type="xsd:string">
447 <xsd:documentation><![CDATA[
448 The name of a factory method to use to create this object. Use
449 constructor-arg elements to specify arguments to the factory method,
450 if it takes arguments. Autowiring does not apply to factory methods.
452 If the "class" attribute is present, the factory method will be a static
453 method on the class specified by the "class" attribute on this bean
454 definition. Often this will be the same class as that of the constructed
455 object - for example, when the factory method is used as an alternative
456 to a constructor. However, it may be on a different class. In that case,
457 the created object will *not* be of the class specified in the "class"
458 attribute. This is analogous to FactoryBean behavior.
460 If the "factory-bean" attribute is present, the "class" attribute is not
461 used, and the factory method will be an instance method on the object
462 returned from a getBean call with the specified bean name. The factory
463 bean may be defined as a singleton or a prototype.
465 The factory method can have any number of arguments. Autowiring is not
466 supported. Use indexed constructor-arg elements in conjunction with the
467 factory-method attribute.
469 Setter Injection can be used in conjunction with a factory method.
470 Method Injection cannot, as the factory method returns an instance,
471 which will be used when the container creates the bean.
472 ]]></xsd:documentation>
475 <xsd:attribute name="factory-bean" type="xsd:string">
477 <xsd:documentation><![CDATA[
478 Alternative to class attribute for factory-method usage.
479 If this is specified, no class attribute should be used.
480 This must be set to the name of a bean in the current or
481 ancestor factories that contains the relevant factory method.
482 This allows the factory itself to be configured using Dependency
483 Injection, and an instance (rather than static) method to be used.
484 ]]></xsd:documentation>
487 <xsd:anyAttribute namespace="##other" processContents="lax"/>
488 </xsd:attributeGroup>
490 <xsd:element name="meta" type="metaType">
492 <xsd:documentation><![CDATA[
493 Arbitrary metadata attached to a bean definition.
494 ]]></xsd:documentation>
498 <xsd:complexType name="metaType">
499 <xsd:attribute name="key" type="xsd:string" use="required">
501 <xsd:documentation><![CDATA[
502 The key name of the metadata attribute being defined.
503 ]]></xsd:documentation>
506 <xsd:attribute name="value" type="xsd:string" use="required">
508 <xsd:documentation><![CDATA[
509 The value of the metadata attribute being defined (as a simple String).
510 ]]></xsd:documentation>
515 <xsd:element name="bean">
517 <xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
518 Defines a single (usually named) bean.
520 A bean definition may contain nested tags for constructor arguments,
521 property values, lookup methods, and replaced methods. Mixing constructor
522 injection and setter injection on the same bean is explicitly supported.
523 ]]></xsd:documentation>
527 <xsd:extension base="identifiedType">
528 <xsd:group ref="beanElements"/>
529 <xsd:attributeGroup ref="beanAttributes"/>
531 </xsd:complexContent>
535 <xsd:element name="constructor-arg">
537 <xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
539 Bean definitions can specify zero or more constructor arguments.
540 This is an alternative to "autowire constructor".
541 Arguments correspond to either a specific index of the constructor
542 argument list or are supposed to be matched generically by type.
544 Note: A single generic argument value will just be used once, rather
545 than potentially matched multiple times (as of Spring 1.1).
547 constructor-arg elements are also used in conjunction with the
548 factory-method element to construct beans using static or instance
550 ]]></xsd:documentation>
554 <xsd:element ref="description" minOccurs="0"/>
555 <xsd:choice minOccurs="0" maxOccurs="1">
556 <xsd:element ref="bean"/>
557 <xsd:element ref="ref"/>
558 <xsd:element ref="idref"/>
559 <xsd:element ref="value"/>
560 <xsd:element ref="null"/>
561 <xsd:element ref="array"/>
562 <xsd:element ref="list"/>
563 <xsd:element ref="set"/>
564 <xsd:element ref="map"/>
565 <xsd:element ref="props"/>
566 <xsd:any namespace="##other" processContents="strict"/>
569 <xsd:attribute name="index" type="xsd:string">
571 <xsd:documentation><![CDATA[
572 The exact index of the argument in the constructor argument list.
573 Only needed to avoid ambiguities, e.g. in case of 2 arguments of
575 ]]></xsd:documentation>
578 <xsd:attribute name="type" type="xsd:string">
580 <xsd:documentation><![CDATA[
581 The exact type of the constructor argument. Only needed to avoid
582 ambiguities, e.g. in case of 2 single argument constructors
583 that can both be converted from a String.
584 ]]></xsd:documentation>
587 <xsd:attribute name="name" type="xsd:string">
589 <xsd:documentation><![CDATA[
590 The exact name of the argument in the constructor argument list.
591 Only needed to avoid ambiguities, e.g. in case of 2 arguments of
592 the exact same type. Note: This requires debug symbols to be
593 stored in the class file in order to introspect argument names!
594 ]]></xsd:documentation>
597 <xsd:attribute name="ref" type="xsd:string">
599 <xsd:documentation><![CDATA[
600 A short-cut alternative to a nested "<ref bean='...'/>" element.
601 ]]></xsd:documentation>
604 <xsd:attribute name="value" type="xsd:string">
606 <xsd:documentation><![CDATA[
607 A short-cut alternative to a nested "<value>...<value/>" element.
608 ]]></xsd:documentation>
614 <xsd:element name="property" type="propertyType">
616 <xsd:documentation><![CDATA[
617 Bean definitions can have zero or more properties.
618 Property elements correspond to JavaBean setter methods exposed
619 by the bean classes. Spring supports primitives, references to other
620 beans in the same or related factories, lists, maps and properties.
621 ]]></xsd:documentation>
625 <xsd:element name="qualifier">
627 <xsd:documentation><![CDATA[
628 Bean definitions can provide qualifiers to match against annotations
629 on a field or parameter for fine-grained autowire candidate resolution.
630 ]]></xsd:documentation>
634 <xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
636 <xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/>
637 <xsd:attribute name="value" type="xsd:string"/>
641 <xsd:element name="attribute" type="metaType">
643 <xsd:documentation><![CDATA[
644 A qualifier element may contain attribute child elements as key-value
645 pairs. These will be available for matching against attributes of a
646 qualifier annotation on an autowired field or parameter if present.
647 ]]></xsd:documentation>
651 <xsd:element name="lookup-method">
653 <xsd:documentation><![CDATA[
654 A lookup method causes the IoC container to override the given method
655 and return the bean with the name given in the bean attribute. This is
656 a form of Method Injection. It is particularly useful as an alternative
657 to implementing the BeanFactoryAware interface, in order to be able to
658 make getBean() calls for non-singleton instances at runtime. In this
659 case, Method Injection is a less invasive alternative.
660 ]]></xsd:documentation>
664 <xsd:restriction base="xsd:anyType">
665 <xsd:attribute name="name" type="xsd:string">
667 <xsd:documentation><![CDATA[
668 The name of the lookup method. This method must take no arguments.
669 ]]></xsd:documentation>
672 <xsd:attribute name="bean" type="xsd:string">
674 <xsd:documentation><![CDATA[
675 The name of the bean in the current or ancestor factories that
676 the lookup method should resolve to. Often this bean will be a
677 prototype, in which case the lookup method will return a distinct
678 instance on every invocation. This is useful for single-threaded objects.
679 ]]></xsd:documentation>
683 </xsd:complexContent>
687 <xsd:element name="replaced-method">
689 <xsd:documentation><![CDATA[
690 Similar to the lookup method mechanism, the replaced-method element
691 is used to control IoC container method overriding: Method Injection.
692 This mechanism allows the overriding of a method with arbitrary code.
693 ]]></xsd:documentation>
697 <xsd:choice minOccurs="0" maxOccurs="unbounded">
698 <xsd:element ref="arg-type"/>
701 <xsd:attribute name="name" type="xsd:string">
703 <xsd:documentation><![CDATA[
704 The name of the method whose implementation must be replaced by the
705 IoC container. If this method is not overloaded, there is no need
706 to use arg-type subelements. If this method is overloaded, arg-type
707 subelements must be used for all override definitions for the method.
708 ]]></xsd:documentation>
711 <xsd:attribute name="replacer" type="xsd:string">
713 <xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
714 Bean name of an implementation of the MethodReplacer interface in the
715 current or ancestor factories. This may be a singleton or prototype
716 bean. If it is a prototype, a new instance will be used for each
717 method replacement. Singleton usage is the norm.
718 ]]></xsd:documentation>
724 <xsd:element name="arg-type">
726 <xsd:documentation><![CDATA[
727 Identifies an argument for a replaced method in the event of
729 ]]></xsd:documentation>
731 <xsd:complexType mixed="true">
732 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
733 <xsd:attribute name="match" type="xsd:string">
735 <xsd:documentation><![CDATA[
736 Specification of the type of an overloaded method argument as a String.
737 For convenience, this may be a substring of the FQN. E.g. all the
738 following would match "java.lang.String":
743 As the number of arguments will be checked also, this convenience
744 can often be used to save typing.
745 ]]></xsd:documentation>
751 <xsd:element name="ref">
753 <xsd:documentation><![CDATA[
754 Defines a reference to another bean in this factory or an external
755 factory (parent or included factory).
756 ]]></xsd:documentation>
760 <xsd:restriction base="xsd:anyType">
761 <xsd:attribute name="bean" type="xsd:string">
763 <xsd:documentation><![CDATA[
764 The name of the referenced bean.
765 ]]></xsd:documentation>
768 <xsd:attribute name="local" type="xsd:string">
770 <xsd:documentation><![CDATA[
771 The name of the referenced bean. The value must be a bean ID and will be
772 checked by the Spring container. This is therefore the preferred technique
773 for referencing beans within the same bean factory XML file.
774 ]]></xsd:documentation>
777 <xsd:attribute name="parent" type="xsd:string">
779 <xsd:documentation><![CDATA[
780 The name of the referenced bean in a parent factory.
781 ]]></xsd:documentation>
785 </xsd:complexContent>
789 <xsd:element name="idref">
791 <xsd:documentation><![CDATA[
792 The id of another bean in this factory or an external factory
793 (parent or included factory).
794 While a regular 'value' element could instead be used for the
795 same effect, using idref indicates that the Spring container
796 should check that the value actually corresponds to a bean id.
797 ]]></xsd:documentation>
801 <xsd:restriction base="xsd:anyType">
802 <xsd:attribute name="bean" type="xsd:string">
804 <xsd:documentation><![CDATA[
805 The name of the referenced bean.
806 ]]></xsd:documentation>
809 <xsd:attribute name="local" type="xsd:string">
811 <xsd:documentation><![CDATA[
812 The name of the referenced bean. The value must be a bean ID and will be
813 checked by the Spring container. This is therefore the preferred technique
814 for referencing beans within the same bean factory XML file.
815 ]]></xsd:documentation>
819 </xsd:complexContent>
823 <xsd:element name="value">
825 <xsd:documentation><![CDATA[
826 Contains a string representation of a property value.
827 The property may be a string, or may be converted to the required
828 type using the JavaBeans PropertyEditor machinery. This makes it
829 possible for application developers to write custom PropertyEditor
830 implementations that can convert strings to arbitrary target objects.
832 Note that this is recommended for simple objects only. Configure
833 more complex objects by populating JavaBean properties with
834 references to other beans.
835 ]]></xsd:documentation>
837 <xsd:complexType mixed="true">
838 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
839 <xsd:attribute name="type" type="xsd:string">
841 <xsd:documentation><![CDATA[
842 The exact type that the value should be converted to. Only needed
843 if the type of the target property or constructor argument is
844 too generic: for example, in case of a collection element.
845 ]]></xsd:documentation>
851 <xsd:element name="null">
853 <xsd:documentation><![CDATA[
854 Denotes a Java null value. Necessary because an empty "value" tag
855 will resolve to an empty String, which will not be resolved to a
856 null value unless a special PropertyEditor does so.
857 ]]></xsd:documentation>
859 <xsd:complexType mixed="true">
860 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
864 <!-- Collection Elements -->
865 <xsd:group name="collectionElements">
867 <xsd:element ref="description" minOccurs="0"/>
868 <xsd:choice minOccurs="0" maxOccurs="unbounded">
869 <xsd:element ref="bean"/>
870 <xsd:element ref="ref"/>
871 <xsd:element ref="idref"/>
872 <xsd:element ref="value"/>
873 <xsd:element ref="null"/>
874 <xsd:element ref="array"/>
875 <xsd:element ref="list"/>
876 <xsd:element ref="set"/>
877 <xsd:element ref="map"/>
878 <xsd:element ref="props"/>
879 <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
884 <xsd:element name="array">
886 <xsd:documentation><![CDATA[
887 An array can contain multiple inner bean, ref, collection, or value elements.
888 This configuration element will always result in an array, even when being
889 defined e.g. as a value for a map with value type Object.
890 ]]></xsd:documentation>
894 <xsd:extension base="listOrSetType">
895 <xsd:attribute name="merge" default="default" type="defaultable-boolean">
897 <xsd:documentation><![CDATA[
898 Enables/disables merging for collections when using parent/child beans.
899 ]]></xsd:documentation>
903 </xsd:complexContent>
907 <xsd:element name="list">
909 <xsd:documentation><![CDATA[
910 A list can contain multiple inner bean, ref, collection, or value elements.
911 A list can also map to an array type; the necessary conversion is performed
913 ]]></xsd:documentation>
917 <xsd:extension base="listOrSetType">
918 <xsd:attribute name="merge" default="default" type="defaultable-boolean">
920 <xsd:documentation><![CDATA[
921 Enables/disables merging for collections when using parent/child beans.
922 ]]></xsd:documentation>
926 </xsd:complexContent>
930 <xsd:element name="set">
932 <xsd:documentation><![CDATA[
933 A set can contain multiple inner bean, ref, collection, or value elements.
934 ]]></xsd:documentation>
938 <xsd:extension base="listOrSetType">
939 <xsd:attribute name="merge" default="default" type="defaultable-boolean">
941 <xsd:documentation><![CDATA[
942 Enables/disables merging for collections when using parent/child beans.
943 ]]></xsd:documentation>
947 </xsd:complexContent>
951 <xsd:element name="map">
953 <xsd:documentation><![CDATA[
954 A mapping from a key to an object. Maps may be empty.
955 ]]></xsd:documentation>
959 <xsd:extension base="mapType">
960 <xsd:attribute name="merge" default="default" type="defaultable-boolean">
962 <xsd:documentation><![CDATA[
963 Enables/disables merging for collections when using parent/child beans.
964 ]]></xsd:documentation>
968 </xsd:complexContent>
972 <xsd:element name="entry" type="entryType">
974 <xsd:documentation><![CDATA[
975 A map entry can be an inner bean, ref, value, or collection.
976 The key of the entry is given by the "key" attribute or child element.
977 ]]></xsd:documentation>
981 <xsd:element name="props">
983 <xsd:documentation><![CDATA[
984 Props elements differ from map elements in that values must be strings.
986 ]]></xsd:documentation>
990 <xsd:extension base="propsType">
991 <xsd:attribute name="merge" default="default" type="defaultable-boolean">
993 <xsd:documentation><![CDATA[
994 Enables/disables merging for collections when using parent/child beans.
995 ]]></xsd:documentation>
999 </xsd:complexContent>
1003 <xsd:element name="key">
1005 <xsd:documentation><![CDATA[
1006 A key element can contain an inner bean, ref, value, or collection.
1007 ]]></xsd:documentation>
1010 <xsd:group ref="collectionElements"/>
1014 <xsd:element name="prop">
1016 <xsd:documentation><![CDATA[
1017 The string value of the property. Note that whitespace is trimmed
1018 off to avoid unwanted whitespace caused by typical XML formatting.
1019 ]]></xsd:documentation>
1021 <xsd:complexType mixed="true">
1022 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
1023 <xsd:attribute name="key" type="xsd:string" use="required">
1025 <xsd:documentation><![CDATA[
1026 The key of the property entry.
1027 ]]></xsd:documentation>
1033 <xsd:complexType name="propertyType">
1035 <xsd:element ref="description" minOccurs="0"/>
1036 <xsd:choice minOccurs="0" maxOccurs="1">
1037 <xsd:element ref="meta"/>
1038 <xsd:element ref="bean"/>
1039 <xsd:element ref="ref"/>
1040 <xsd:element ref="idref"/>
1041 <xsd:element ref="value"/>
1042 <xsd:element ref="null"/>
1043 <xsd:element ref="array"/>
1044 <xsd:element ref="list"/>
1045 <xsd:element ref="set"/>
1046 <xsd:element ref="map"/>
1047 <xsd:element ref="props"/>
1048 <xsd:any namespace="##other" processContents="strict"/>
1051 <xsd:attribute name="name" type="xsd:string" use="required">
1053 <xsd:documentation><![CDATA[
1054 The name of the property, following JavaBean naming conventions.
1055 ]]></xsd:documentation>
1058 <xsd:attribute name="ref" type="xsd:string">
1060 <xsd:documentation><![CDATA[
1061 A short-cut alternative to a nested "<ref bean='...'/>".
1062 ]]></xsd:documentation>
1065 <xsd:attribute name="value" type="xsd:string">
1067 <xsd:documentation><![CDATA[
1068 A short-cut alternative to a nested "<value>...</value>" element.
1069 ]]></xsd:documentation>
1074 <!-- Collection Types -->
1076 <!-- base type for collections that have (possibly) typed nested values -->
1077 <xsd:complexType name="collectionType">
1078 <xsd:attribute name="value-type" type="xsd:string">
1080 <xsd:documentation source="java:java.lang.Class"><![CDATA[
1081 The default Java type for nested values. Must be a fully qualified
1083 ]]></xsd:documentation>
1088 <!-- 'list' and 'set' collection type -->
1089 <xsd:complexType name="listOrSetType">
1090 <xsd:complexContent>
1091 <xsd:extension base="collectionType">
1092 <xsd:group ref="collectionElements"/>
1094 </xsd:complexContent>
1097 <!-- 'map' element type -->
1098 <xsd:complexType name="mapType">
1099 <xsd:complexContent>
1100 <xsd:extension base="collectionType">
1102 <xsd:element ref="description" minOccurs="0"/>
1103 <xsd:choice minOccurs="0" maxOccurs="unbounded">
1104 <xsd:element ref="entry"/>
1107 <xsd:attribute name="key-type" type="xsd:string">
1109 <xsd:documentation source="java:java.lang.Class"><![CDATA[
1110 The default Java type for nested entry keys. Must be a fully qualified
1112 ]]></xsd:documentation>
1116 </xsd:complexContent>
1119 <!-- 'entry' element type -->
1120 <xsd:complexType name="entryType">
1122 <xsd:element ref="key" minOccurs="0"/>
1123 <xsd:group ref="collectionElements"/>
1125 <xsd:attribute name="key" type="xsd:string">
1127 <xsd:documentation><![CDATA[
1128 Each map element must specify its key as attribute or as child element.
1129 A key attribute is always a String value.
1130 ]]></xsd:documentation>
1133 <xsd:attribute name="key-ref" type="xsd:string">
1135 <xsd:documentation><![CDATA[
1136 A short-cut alternative to a to a "key" element with a nested
1137 "<ref bean='...'/>".
1138 ]]></xsd:documentation>
1141 <xsd:attribute name="value" type="xsd:string">
1143 <xsd:documentation><![CDATA[
1144 A short-cut alternative to a nested "<value>...</value>"
1146 ]]></xsd:documentation>
1149 <xsd:attribute name="value-ref" type="xsd:string">
1151 <xsd:documentation><![CDATA[
1152 A short-cut alternative to a nested "<ref bean='...'/>".
1153 ]]></xsd:documentation>
1158 <!-- 'props' collection type -->
1159 <xsd:complexType name="propsType">
1160 <xsd:complexContent>
1161 <xsd:extension base="collectionType">
1163 <xsd:choice minOccurs="0" maxOccurs="unbounded">
1164 <xsd:element ref="prop"/>
1168 </xsd:complexContent>
1171 <!-- simple internal types -->
1172 <xsd:simpleType name="defaultable-boolean">
1173 <xsd:restriction base="xsd:NMTOKEN">
1174 <xsd:enumeration value="default"/>
1175 <xsd:enumeration value="true"/>
1176 <xsd:enumeration value="false"/>