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 2.5
12 Authors: Rob Harrop, Juergen Hoeller, Mark Fisher
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:ID">
52 <xsd:documentation><![CDATA[
53 The unique identifier for a bean.
54 ]]></xsd:documentation>
59 <!-- Top-level <beans> tag -->
60 <xsd:element name="beans">
62 <xsd:documentation><![CDATA[
63 The top level (typically root) element. Allows the definition
64 of default values for all nested bean definitions.
65 ]]></xsd:documentation>
69 <xsd:element ref="description" minOccurs="0"/>
70 <xsd:choice minOccurs="0" maxOccurs="unbounded">
71 <xsd:element ref="import"/>
72 <xsd:element ref="alias"/>
73 <xsd:element ref="bean"/>
74 <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
77 <xsd:attribute name="default-lazy-init" default="false" type="xsd:boolean">
79 <xsd:documentation><![CDATA[
80 The default 'lazy-init' value; see the documentation for the
81 'lazy-init' attribute of the '<bean>' element.
82 ]]></xsd:documentation>
85 <xsd:attribute name="default-merge" default="false" type="xsd:boolean">
87 <xsd:documentation><![CDATA[
88 The default 'merge' value; see the documentation for the
89 'merge' attribute of the various collection elements.
90 ]]></xsd:documentation>
93 <xsd:attribute name="default-autowire" default="no">
95 <xsd:documentation><![CDATA[
96 The default 'autowire' value; see the documentation for the
97 'autowire' attribute of the '<bean>' element.
98 ]]></xsd:documentation>
101 <xsd:restriction base="xsd:NMTOKEN">
102 <xsd:enumeration value="no"/>
103 <xsd:enumeration value="byName"/>
104 <xsd:enumeration value="byType"/>
105 <xsd:enumeration value="constructor"/>
106 <xsd:enumeration value="autodetect"/>
110 <xsd:attribute name="default-dependency-check" default="none">
112 <xsd:documentation><![CDATA[
113 The default 'dependency-check' value; see the documentation for the
114 'dependency-check' attribute of the '<bean>' element.
115 ]]></xsd:documentation>
118 <xsd:restriction base="xsd:NMTOKEN">
119 <xsd:enumeration value="none"/>
120 <xsd:enumeration value="simple"/>
121 <xsd:enumeration value="objects"/>
122 <xsd:enumeration value="all"/>
126 <xsd:attribute name="default-autowire-candidates" type="xsd:string">
128 <xsd:documentation><![CDATA[
129 A default bean name pattern for identifying autowire candidates:
130 e.g. "*Service", "data*", "*Service*", "data*Service".
131 Also accepts a comma-separated list of patterns: e.g. "*Service,*Dao".
132 See the documentation for the 'autowire-candidate' attribute of the
133 '<bean/>' element for the semantic details of autowire candidate beans.
134 ]]></xsd:documentation>
137 <xsd:attribute name="default-init-method" type="xsd:string">
139 <xsd:documentation><![CDATA[
140 The default 'init-method' value; see the documentation for the
141 'init-method' attribute of the '<bean>' element.
142 ]]></xsd:documentation>
145 <xsd:attribute name="default-destroy-method" type="xsd:string">
147 <xsd:documentation><![CDATA[
148 The default 'destroy-method' value; see the documentation for the
149 'destroy-method' attribute of the '<bean>' element.
150 ]]></xsd:documentation>
153 <xsd:anyAttribute namespace="##other" processContents="lax"/>
157 <xsd:element name="description">
159 <xsd:documentation><![CDATA[
160 Contains informative text describing the purpose of the enclosing element.
161 Used primarily for user documentation of XML bean definition documents.
162 ]]></xsd:documentation>
164 <xsd:complexType mixed="true">
165 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
169 <xsd:element name="import">
171 <xsd:documentation source="java:org.springframework.core.io.Resource"><![CDATA[
172 Specifies an XML bean definition resource to import.
173 ]]></xsd:documentation>
177 <xsd:restriction base="xsd:anyType">
178 <xsd:attribute name="resource" type="xsd:string" use="required">
180 <xsd:documentation><![CDATA[
181 The relative resource location of the XML (bean definition) file to import,
182 for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
183 ]]></xsd:documentation>
187 </xsd:complexContent>
191 <xsd:element name="alias">
193 <xsd:documentation><![CDATA[
194 Defines an alias for a bean (which can reside in a different definition
196 ]]></xsd:documentation>
200 <xsd:restriction base="xsd:anyType">
201 <xsd:attribute name="name" type="xsd:string" use="required">
203 <xsd:documentation><![CDATA[
204 The name of the bean to define an alias for.
205 ]]></xsd:documentation>
208 <xsd:attribute name="alias" type="xsd:string" use="required">
210 <xsd:documentation><![CDATA[
211 The alias name to define for the bean.
212 ]]></xsd:documentation>
216 </xsd:complexContent>
220 <xsd:group name="beanElements">
222 <xsd:element ref="description" minOccurs="0"/>
223 <xsd:choice minOccurs="0" maxOccurs="unbounded">
224 <xsd:element ref="meta"/>
225 <xsd:element ref="constructor-arg"/>
226 <xsd:element ref="property"/>
227 <xsd:element ref="qualifier"/>
228 <xsd:element ref="lookup-method"/>
229 <xsd:element ref="replaced-method"/>
230 <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
235 <xsd:attributeGroup name="beanAttributes">
236 <xsd:attribute name="name" type="xsd:string">
238 <xsd:documentation><![CDATA[
239 Can be used to create one or more aliases illegal in an (XML) id.
240 Multiple aliases can be separated by any number of spaces, commas,
241 or semi-colons (or indeed any mixture of the three).
242 ]]></xsd:documentation>
245 <xsd:attribute name="class" type="xsd:string">
247 <xsd:documentation source="java:java.lang.Class"><![CDATA[
248 The fully qualified name of the bean's class, except if it serves only
249 as a parent definition for child bean definitions.
250 ]]></xsd:documentation>
253 <xsd:attribute name="parent" type="xsd:string">
255 <xsd:documentation><![CDATA[
256 The name of the parent bean definition.
258 Will use the bean class of the parent if none is specified, but can
259 also override it. In the latter case, the child bean class must be
260 compatible with the parent, i.e. accept the parent's property values
261 and constructor argument values, if any.
263 A child bean definition will inherit constructor argument values,
264 property values and method overrides from the parent, with the option
265 to add new values. If init method, destroy method, factory bean and/or
266 factory method are specified, they will override the corresponding
269 The remaining settings will always be taken from the child definition:
270 depends on, autowire mode, dependency check, scope, lazy init.
271 ]]></xsd:documentation>
274 <xsd:attribute name="scope" type="xsd:string">
276 <xsd:documentation><![CDATA[
277 The scope of this bean: typically "singleton" (one shared instance,
278 which will be returned by all calls to getBean with the given id), or
279 "prototype" (independent instance resulting from each call to getBean).
280 Default is "singleton".
282 Singletons are most commonly used, and are ideal for multi-threaded
283 service objects. Further scopes, such as "request" or "session", might
284 be supported by extended bean factories (e.g. in a web environment).
286 Note: This attribute will not be inherited by child bean definitions.
287 Hence, it needs to be specified per concrete bean definition.
289 Inner bean definitions inherit the singleton status of their containing
290 bean definition, unless explicitly specified: The inner bean will be a
291 singleton if the containing bean is a singleton, and a prototype if
292 the containing bean has any other scope.
293 ]]></xsd:documentation>
296 <xsd:attribute name="abstract" type="xsd:boolean">
298 <xsd:documentation><![CDATA[
299 Is this bean "abstract", that is, not meant to be instantiated itself
300 but rather just serving as parent for concrete child bean definitions?
301 The default is "false". Specify "true" to tell the bean factory to not
302 try to instantiate that particular bean in any case.
304 Note: This attribute will not be inherited by child bean definitions.
305 Hence, it needs to be specified per abstract bean definition.
306 ]]></xsd:documentation>
309 <xsd:attribute name="lazy-init" default="default" type="defaultable-boolean">
311 <xsd:documentation><![CDATA[
312 Indicates whether or not this bean is to be lazily initialized.
313 If false, it will be instantiated on startup by bean factories
314 that perform eager initialization of singletons. The default is
317 Note: This attribute will not be inherited by child bean definitions.
318 Hence, it needs to be specified per concrete bean definition.
319 ]]></xsd:documentation>
322 <xsd:attribute name="autowire" default="default">
324 <xsd:documentation><![CDATA[
325 Controls whether bean properties are "autowired".
326 This is an automagical process in which bean references don't need
327 to be coded explicitly in the XML bean definition file, but rather the
328 Spring container works out dependencies.
333 The traditional Spring default. No automagical wiring. Bean references
334 must be defined in the XML file via the <ref/> element (or "ref"
335 attribute). We recommend this in most cases as it makes documentation
339 Autowiring by property name. If a bean of class Cat exposes a "dog"
340 property, Spring will try to set this to the value of the bean "dog"
341 in the current container. If there is no matching bean by name, nothing
342 special happens; use dependency-check="objects" to raise an error in
346 Autowiring if there is exactly one bean of the property type in the
347 container. If there is more than one, a fatal error is raised, and
348 you cannot use byType autowiring for that bean. If there is none,
349 nothing special happens; use dependency-check="objects" to raise an
353 Analogous to "byType" for constructor arguments. If there is not exactly
354 one bean of the constructor argument type in the bean factory, a fatal
358 Chooses "constructor" or "byType" through introspection of the bean
359 class. If a default constructor is found, "byType" gets applied.
361 Note that explicit dependencies, i.e. "property" and "constructor-arg"
362 elements, always override autowiring. Autowire behavior can be combined
363 with dependency checking, which will be performed after all autowiring
366 Note: This attribute will not be inherited by child bean definitions.
367 Hence, it needs to be specified per concrete bean definition.
368 ]]></xsd:documentation>
371 <xsd:restriction base="xsd:NMTOKEN">
372 <xsd:enumeration value="default"/>
373 <xsd:enumeration value="no"/>
374 <xsd:enumeration value="byName"/>
375 <xsd:enumeration value="byType"/>
376 <xsd:enumeration value="constructor"/>
377 <xsd:enumeration value="autodetect"/>
381 <xsd:attribute name="dependency-check" default="default">
383 <xsd:documentation><![CDATA[
384 Controls whether or not to check whether all of this
385 bean's dependencies, expressed in its properties, are satisfied.
386 The default is to perform no dependency checking.
388 "simple" type dependency checking includes primitives and String;
389 "objects" includes collaborators (other beans in the factory);
390 "all" includes both types of dependency checking.
392 Note: This attribute will not be inherited by child bean definitions.
393 Hence, it needs to be specified per concrete bean definition.
394 ]]></xsd:documentation>
397 <xsd:restriction base="xsd:NMTOKEN">
398 <xsd:enumeration value="default"/>
399 <xsd:enumeration value="none"/>
400 <xsd:enumeration value="simple"/>
401 <xsd:enumeration value="objects"/>
402 <xsd:enumeration value="all"/>
406 <xsd:attribute name="depends-on" type="xsd:string">
408 <xsd:documentation><![CDATA[
409 The names of the beans that this bean depends on being initialized.
410 The bean factory will guarantee that these beans get initialized
413 Note that dependencies are normally expressed through bean properties
414 or constructor arguments. This property should just be necessary for
415 other kinds of dependencies like statics (*ugh*) or database preparation
418 Note: This attribute will not be inherited by child bean definitions.
419 Hence, it needs to be specified per concrete bean definition.
420 ]]></xsd:documentation>
423 <xsd:attribute name="autowire-candidate" default="default" type="defaultable-boolean">
425 <xsd:documentation><![CDATA[
426 Indicates whether or not this bean should be considered when looking
427 for matching candidates to satisfy another bean's autowiring requirements.
428 Note that this does not affect explicit references by name, which will get
429 resolved even if the specified bean is not marked as an autowire candidate.
430 ]]></xsd:documentation>
433 <xsd:attribute name="primary" type="xsd:boolean">
435 <xsd:documentation><![CDATA[
436 Specifies that this bean should be given preference when multiple
437 candidates are qualified to autowire a single-valued dependency.
438 If exactly one 'primary' bean exists among the candidates, it
439 will be the autowired value.
440 ]]></xsd:documentation>
443 <xsd:attribute name="init-method" type="xsd:string">
445 <xsd:documentation><![CDATA[
446 The name of the custom initialization method to invoke after setting
447 bean properties. The method must have no arguments, but may throw any
449 ]]></xsd:documentation>
452 <xsd:attribute name="destroy-method" type="xsd:string">
454 <xsd:documentation><![CDATA[
455 The name of the custom destroy method to invoke on bean factory
456 shutdown. The method must have no arguments, but may throw any
459 Note: Only invoked on beans whose lifecycle is under the full
460 control of the factory - which is always the case for singletons,
461 but not guaranteed for any other scope.
462 ]]></xsd:documentation>
465 <xsd:attribute name="factory-method" type="xsd:string">
467 <xsd:documentation><![CDATA[
468 The name of a factory method to use to create this object. Use
469 constructor-arg elements to specify arguments to the factory method,
470 if it takes arguments. Autowiring does not apply to factory methods.
472 If the "class" attribute is present, the factory method will be a static
473 method on the class specified by the "class" attribute on this bean
474 definition. Often this will be the same class as that of the constructed
475 object - for example, when the factory method is used as an alternative
476 to a constructor. However, it may be on a different class. In that case,
477 the created object will *not* be of the class specified in the "class"
478 attribute. This is analogous to FactoryBean behavior.
480 If the "factory-bean" attribute is present, the "class" attribute is not
481 used, and the factory method will be an instance method on the object
482 returned from a getBean call with the specified bean name. The factory
483 bean may be defined as a singleton or a prototype.
485 The factory method can have any number of arguments. Autowiring is not
486 supported. Use indexed constructor-arg elements in conjunction with the
487 factory-method attribute.
489 Setter Injection can be used in conjunction with a factory method.
490 Method Injection cannot, as the factory method returns an instance,
491 which will be used when the container creates the bean.
492 ]]></xsd:documentation>
495 <xsd:attribute name="factory-bean" type="xsd:string">
497 <xsd:documentation><![CDATA[
498 Alternative to class attribute for factory-method usage.
499 If this is specified, no class attribute should be used.
500 This must be set to the name of a bean in the current or
501 ancestor factories that contains the relevant factory method.
502 This allows the factory itself to be configured using Dependency
503 Injection, and an instance (rather than static) method to be used.
504 ]]></xsd:documentation>
507 <xsd:anyAttribute namespace="##other" processContents="lax"/>
508 </xsd:attributeGroup>
510 <xsd:element name="meta" type="metaType">
512 <xsd:documentation><![CDATA[
513 Arbitrary metadata attached to a bean definition.
514 ]]></xsd:documentation>
518 <xsd:complexType name="metaType">
519 <xsd:attribute name="key" type="xsd:string" use="required">
521 <xsd:documentation><![CDATA[
522 The key name of the metadata attribute being defined.
523 ]]></xsd:documentation>
526 <xsd:attribute name="value" type="xsd:string" use="required">
528 <xsd:documentation><![CDATA[
529 The value of the metadata attribute being defined (as a simple String).
530 ]]></xsd:documentation>
535 <xsd:element name="bean">
537 <xsd:documentation source="java:org.springframework.beans.factory.config.BeanDefinition"><![CDATA[
538 Defines a single (usually named) bean.
540 A bean definition may contain nested tags for constructor arguments,
541 property values, lookup methods, and replaced methods. Mixing constructor
542 injection and setter injection on the same bean is explicitly supported.
543 ]]></xsd:documentation>
547 <xsd:extension base="identifiedType">
548 <xsd:group ref="beanElements"/>
549 <xsd:attributeGroup ref="beanAttributes"/>
551 </xsd:complexContent>
555 <xsd:element name="constructor-arg">
557 <xsd:documentation source="java:org.springframework.beans.factory.config.ConstructorArgumentValues">
559 Bean definitions can specify zero or more constructor arguments.
560 This is an alternative to "autowire constructor".
561 Arguments correspond to either a specific index of the constructor
562 argument list or are supposed to be matched generically by type.
564 Note: A single generic argument value will just be used once, rather
565 than potentially matched multiple times (as of Spring 1.1).
567 constructor-arg elements are also used in conjunction with the
568 factory-method element to construct beans using static or instance
570 ]]></xsd:documentation>
574 <xsd:element ref="description" minOccurs="0"/>
575 <xsd:choice minOccurs="0" maxOccurs="1">
576 <xsd:element ref="bean"/>
577 <xsd:element ref="ref"/>
578 <xsd:element ref="idref"/>
579 <xsd:element ref="value"/>
580 <xsd:element ref="null"/>
581 <xsd:element ref="list"/>
582 <xsd:element ref="set"/>
583 <xsd:element ref="map"/>
584 <xsd:element ref="props"/>
585 <xsd:any namespace="##other" processContents="strict"/>
588 <xsd:attribute name="index" type="xsd:string">
590 <xsd:documentation><![CDATA[
591 The exact index of the argument in the constructor argument list.
592 Only needed to avoid ambiguities, e.g. in case of 2 arguments of
594 ]]></xsd:documentation>
597 <xsd:attribute name="type" type="xsd:string">
599 <xsd:documentation><![CDATA[
600 The exact type of the constructor argument. Only needed to avoid
601 ambiguities, e.g. in case of 2 single argument constructors
602 that can both be converted from a String.
603 ]]></xsd:documentation>
606 <xsd:attribute name="ref" type="xsd:string">
608 <xsd:documentation><![CDATA[
609 A short-cut alternative to a nested "<ref bean='...'/>" element.
610 ]]></xsd:documentation>
613 <xsd:attribute name="value" type="xsd:string">
615 <xsd:documentation><![CDATA[
616 A short-cut alternative to a nested "<value>...<value/>" element.
617 ]]></xsd:documentation>
623 <xsd:element name="property" type="propertyType">
625 <xsd:documentation><![CDATA[
626 Bean definitions can have zero or more properties.
627 Property elements correspond to JavaBean setter methods exposed
628 by the bean classes. Spring supports primitives, references to other
629 beans in the same or related factories, lists, maps and properties.
630 ]]></xsd:documentation>
634 <xsd:element name="qualifier">
636 <xsd:documentation><![CDATA[
637 Bean definitions can provide qualifiers to match against annotations
638 on a field or parameter for fine-grained autowire candidate resolution.
639 ]]></xsd:documentation>
643 <xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
645 <xsd:attribute name="type" type="xsd:string" default="org.springframework.beans.factory.annotation.Qualifier"/>
646 <xsd:attribute name="value" type="xsd:string"/>
650 <xsd:element name="attribute" type="metaType">
652 <xsd:documentation><![CDATA[
653 A qualifier element may contain attribute child elements as key-value
654 pairs. These will be available for matching against attributes of a
655 qualifier annotation on an autowired field or parameter if present.
656 ]]></xsd:documentation>
660 <xsd:element name="lookup-method">
662 <xsd:documentation><![CDATA[
663 A lookup method causes the IoC container to override the given method
664 and return the bean with the name given in the bean attribute. This is
665 a form of Method Injection. It is particularly useful as an alternative
666 to implementing the BeanFactoryAware interface, in order to be able to
667 make getBean() calls for non-singleton instances at runtime. In this
668 case, Method Injection is a less invasive alternative.
669 ]]></xsd:documentation>
673 <xsd:restriction base="xsd:anyType">
674 <xsd:attribute name="name" type="xsd:string">
676 <xsd:documentation><![CDATA[
677 The name of the lookup method. This method must take no arguments.
678 ]]></xsd:documentation>
681 <xsd:attribute name="bean" type="xsd:string">
683 <xsd:documentation><![CDATA[
684 The name of the bean in the current or ancestor factories that
685 the lookup method should resolve to. Often this bean will be a
686 prototype, in which case the lookup method will return a distinct
687 instance on every invocation. This is useful for single-threaded objects.
688 ]]></xsd:documentation>
692 </xsd:complexContent>
696 <xsd:element name="replaced-method">
698 <xsd:documentation><![CDATA[
699 Similar to the lookup method mechanism, the replaced-method element
700 is used to control IoC container method overriding: Method Injection.
701 This mechanism allows the overriding of a method with arbitrary code.
702 ]]></xsd:documentation>
706 <xsd:choice minOccurs="0" maxOccurs="unbounded">
707 <xsd:element ref="arg-type"/>
710 <xsd:attribute name="name" type="xsd:string">
712 <xsd:documentation><![CDATA[
713 The name of the method whose implementation must be replaced by the
714 IoC container. If this method is not overloaded, there is no need
715 to use arg-type subelements. If this method is overloaded, arg-type
716 subelements must be used for all override definitions for the method.
717 ]]></xsd:documentation>
720 <xsd:attribute name="replacer" type="xsd:string">
722 <xsd:documentation source="java:org.springframework.beans.factory.support.MethodReplacer"><![CDATA[
723 Bean name of an implementation of the MethodReplacer interface in the
724 current or ancestor factories. This may be a singleton or prototype
725 bean. If it is a prototype, a new instance will be used for each
726 method replacement. Singleton usage is the norm.
727 ]]></xsd:documentation>
733 <xsd:element name="arg-type">
735 <xsd:documentation><![CDATA[
736 Identifies an argument for a replaced method in the event of
738 ]]></xsd:documentation>
740 <xsd:complexType mixed="true">
741 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
742 <xsd:attribute name="match" type="xsd:string">
744 <xsd:documentation><![CDATA[
745 Specification of the type of an overloaded method argument as a String.
746 For convenience, this may be a substring of the FQN. E.g. all the
747 following would match "java.lang.String":
752 As the number of arguments will be checked also, this convenience
753 can often be used to save typing.
754 ]]></xsd:documentation>
760 <xsd:element name="ref">
762 <xsd:documentation><![CDATA[
763 Defines a reference to another bean in this factory or an external
764 factory (parent or included factory).
765 ]]></xsd:documentation>
769 <xsd:restriction base="xsd:anyType">
770 <xsd:attribute name="bean" type="xsd:string">
772 <xsd:documentation><![CDATA[
773 The name of the referenced bean.
774 ]]></xsd:documentation>
777 <xsd:attribute name="local" type="xsd:IDREF">
779 <xsd:documentation><![CDATA[
780 The name of the referenced bean. The value must be a bean ID and thus can
781 be checked by the XML parser. This is therefore the preferred technique
782 for referencing beans within the same bean factory XML file.
783 ]]></xsd:documentation>
786 <xsd:attribute name="parent" type="xsd:string">
788 <xsd:documentation><![CDATA[
789 The name of the referenced bean in a parent factory.
790 ]]></xsd:documentation>
794 </xsd:complexContent>
798 <xsd:element name="idref">
800 <xsd:documentation><![CDATA[
801 The id of another bean in this factory or an external factory
802 (parent or included factory).
803 While a regular 'value' element could instead be used for the
804 same effect, using idref in this case allows validation of local
805 bean ids by the XML parser, and name completion by supporting tools.
806 ]]></xsd:documentation>
810 <xsd:restriction base="xsd:anyType">
811 <xsd:attribute name="bean" type="xsd:string">
813 <xsd:documentation><![CDATA[
814 The name of the referenced bean.
815 ]]></xsd:documentation>
818 <xsd:attribute name="local" type="xsd:IDREF">
820 <xsd:documentation><![CDATA[
821 The name of the referenced bean. The value must be a bean ID and thus can
822 be checked by the XML parser. This is therefore the preferred technique
823 for referencing beans within the same bean factory XML file.
824 ]]></xsd:documentation>
828 </xsd:complexContent>
832 <xsd:element name="value">
834 <xsd:documentation><![CDATA[
835 Contains a string representation of a property value.
836 The property may be a string, or may be converted to the required
837 type using the JavaBeans PropertyEditor machinery. This makes it
838 possible for application developers to write custom PropertyEditor
839 implementations that can convert strings to arbitrary target objects.
841 Note that this is recommended for simple objects only. Configure
842 more complex objects by populating JavaBean properties with
843 references to other beans.
844 ]]></xsd:documentation>
846 <xsd:complexType mixed="true">
847 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
848 <xsd:attribute name="type" type="xsd:string">
850 <xsd:documentation><![CDATA[
851 The exact type that the value should be converted to. Only needed
852 if the type of the target property or constructor argument is
853 too generic: for example, in case of a collection element.
854 ]]></xsd:documentation>
860 <xsd:element name="null">
862 <xsd:documentation><![CDATA[
863 Denotes a Java null value. Necessary because an empty "value" tag
864 will resolve to an empty String, which will not be resolved to a
865 null value unless a special PropertyEditor does so.
866 ]]></xsd:documentation>
868 <xsd:complexType mixed="true">
869 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
873 <!-- Collection Elements -->
874 <xsd:group name="collectionElements">
876 <xsd:element ref="description" minOccurs="0"/>
877 <xsd:choice minOccurs="0" maxOccurs="unbounded">
878 <xsd:element ref="bean"/>
879 <xsd:element ref="ref"/>
880 <xsd:element ref="idref"/>
881 <xsd:element ref="value"/>
882 <xsd:element ref="null"/>
883 <xsd:element ref="list"/>
884 <xsd:element ref="set"/>
885 <xsd:element ref="map"/>
886 <xsd:element ref="props"/>
887 <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
892 <xsd:element name="list">
894 <xsd:documentation><![CDATA[
895 A list can contain multiple inner bean, ref, collection, or value elements.
896 A list can also map to an array type; the necessary conversion is performed
898 ]]></xsd:documentation>
902 <xsd:extension base="listOrSetType">
903 <xsd:attribute name="merge" type="defaultable-boolean">
905 <xsd:documentation><![CDATA[
906 Enables/disables merging for collections when using parent/child beans.
907 ]]></xsd:documentation>
911 </xsd:complexContent>
915 <xsd:element name="set">
917 <xsd:documentation><![CDATA[
918 A set can contain multiple inner bean, ref, collection, or value elements.
919 ]]></xsd:documentation>
923 <xsd:extension base="listOrSetType">
924 <xsd:attribute name="merge" type="defaultable-boolean">
926 <xsd:documentation><![CDATA[
927 Enables/disables merging for collections when using parent/child beans.
928 ]]></xsd:documentation>
932 </xsd:complexContent>
936 <xsd:element name="map">
938 <xsd:documentation><![CDATA[
939 A mapping from a key to an object. Maps may be empty.
940 ]]></xsd:documentation>
944 <xsd:extension base="mapType">
945 <xsd:attribute name="merge" type="defaultable-boolean">
947 <xsd:documentation><![CDATA[
948 Enables/disables merging for collections when using parent/child beans.
949 ]]></xsd:documentation>
953 </xsd:complexContent>
957 <xsd:element name="entry" type="entryType">
959 <xsd:documentation><![CDATA[
960 A map entry can be an inner bean, ref, value, or collection.
961 The key of the entry is given by the "key" attribute or child element.
962 ]]></xsd:documentation>
966 <xsd:element name="props">
968 <xsd:documentation><![CDATA[
969 Props elements differ from map elements in that values must be strings.
971 ]]></xsd:documentation>
975 <xsd:extension base="propsType">
976 <xsd:attribute name="merge" type="defaultable-boolean">
978 <xsd:documentation><![CDATA[
979 Enables/disables merging for collections when using parent/child beans.
980 ]]></xsd:documentation>
984 </xsd:complexContent>
988 <xsd:element name="key">
990 <xsd:documentation><![CDATA[
991 A key element can contain an inner bean, ref, value, or collection.
992 ]]></xsd:documentation>
995 <xsd:group ref="collectionElements"/>
999 <xsd:element name="prop">
1001 <xsd:documentation><![CDATA[
1002 The string value of the property. Note that whitespace is trimmed
1003 off to avoid unwanted whitespace caused by typical XML formatting.
1004 ]]></xsd:documentation>
1006 <xsd:complexType mixed="true">
1007 <xsd:choice minOccurs="0" maxOccurs="unbounded"/>
1008 <xsd:attribute name="key" type="xsd:string" use="required">
1010 <xsd:documentation><![CDATA[
1011 The key of the property entry.
1012 ]]></xsd:documentation>
1018 <xsd:complexType name="propertyType">
1020 <xsd:element ref="description" minOccurs="0"/>
1021 <xsd:choice minOccurs="0" maxOccurs="1">
1022 <xsd:element ref="meta"/>
1023 <xsd:element ref="bean"/>
1024 <xsd:element ref="ref"/>
1025 <xsd:element ref="idref"/>
1026 <xsd:element ref="value"/>
1027 <xsd:element ref="null"/>
1028 <xsd:element ref="list"/>
1029 <xsd:element ref="set"/>
1030 <xsd:element ref="map"/>
1031 <xsd:element ref="props"/>
1032 <xsd:any namespace="##other" processContents="strict"/>
1035 <xsd:attribute name="name" type="xsd:string" use="required">
1037 <xsd:documentation><![CDATA[
1038 The name of the property, following JavaBean naming conventions.
1039 ]]></xsd:documentation>
1042 <xsd:attribute name="ref" type="xsd:string">
1044 <xsd:documentation><![CDATA[
1045 A short-cut alternative to a nested "<ref bean='...'/>".
1046 ]]></xsd:documentation>
1049 <xsd:attribute name="value" type="xsd:string">
1051 <xsd:documentation><![CDATA[
1052 A short-cut alternative to a nested "<value>...</value>" element.
1053 ]]></xsd:documentation>
1058 <!-- Collection Types -->
1060 <!-- base type for collections that have (possibly) typed nested values -->
1061 <xsd:complexType name="collectionType">
1062 <xsd:attribute name="value-type" type="xsd:string">
1064 <xsd:documentation source="java:java.lang.Class"><![CDATA[
1065 The default Java type for nested values. Must be a fully qualified
1067 ]]></xsd:documentation>
1072 <!-- 'list' and 'set' collection type -->
1073 <xsd:complexType name="listOrSetType">
1074 <xsd:complexContent>
1075 <xsd:extension base="collectionType">
1076 <xsd:group ref="collectionElements"/>
1078 </xsd:complexContent>
1081 <!-- 'map' element type -->
1082 <xsd:complexType name="mapType">
1083 <xsd:complexContent>
1084 <xsd:extension base="collectionType">
1086 <xsd:element ref="description" minOccurs="0"/>
1087 <xsd:choice minOccurs="0" maxOccurs="unbounded">
1088 <xsd:element ref="entry"/>
1091 <xsd:attribute name="key-type" type="xsd:string">
1093 <xsd:documentation source="java:java.lang.Class"><![CDATA[
1094 The default Java type for nested entry keys. Must be a fully qualified
1096 ]]></xsd:documentation>
1100 </xsd:complexContent>
1103 <!-- 'entry' element type -->
1104 <xsd:complexType name="entryType">
1106 <xsd:element ref="key" minOccurs="0"/>
1107 <xsd:group ref="collectionElements"/>
1109 <xsd:attribute name="key" type="xsd:string">
1111 <xsd:documentation><![CDATA[
1112 Each map element must specify its key as attribute or as child element.
1113 A key attribute is always a String value.
1114 ]]></xsd:documentation>
1117 <xsd:attribute name="key-ref" type="xsd:string">
1119 <xsd:documentation><![CDATA[
1120 A short-cut alternative to a to a "key" element with a nested
1121 "<ref bean='...'/>".
1122 ]]></xsd:documentation>
1125 <xsd:attribute name="value" type="xsd:string">
1127 <xsd:documentation><![CDATA[
1128 A short-cut alternative to a nested "<value>...</value>"
1130 ]]></xsd:documentation>
1133 <xsd:attribute name="value-ref" type="xsd:string">
1135 <xsd:documentation><![CDATA[
1136 A short-cut alternative to a nested "<ref bean='...'/>".
1137 ]]></xsd:documentation>
1142 <!-- 'props' collection type -->
1143 <xsd:complexType name="propsType">
1144 <xsd:complexContent>
1145 <xsd:extension base="collectionType">
1147 <xsd:choice minOccurs="0" maxOccurs="unbounded">
1148 <xsd:element ref="prop"/>
1152 </xsd:complexContent>
1155 <!-- simple internal types -->
1156 <xsd:simpleType name="defaultable-boolean">
1157 <xsd:restriction base="xsd:NMTOKEN">
1158 <xsd:enumeration value="default"/>
1159 <xsd:enumeration value="true"/>
1160 <xsd:enumeration value="false"/>