svn-gvsig-desktop / tmp / trunk / servidor / WPS_Callejero_Server / wps / WebContent / WEB-INF / spring-beans-2.0.dtd @ 26650
History | View | Annotate | Download (23.6 KB)
1 |
<!-- |
---|---|
2 |
Spring XML Beans DTD, version 2.0 |
3 |
Authors: Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu, Rob Harrop |
4 |
|
5 |
This defines a simple and consistent way of creating a namespace |
6 |
of JavaBeans objects, managed by a Spring BeanFactory, read by |
7 |
XmlBeanDefinitionReader (with DefaultBeanDefinitionDocumentReader). |
8 |
|
9 |
This document type is used by most Spring functionality, including |
10 |
web application contexts, which are based on bean factories. |
11 |
|
12 |
Each "bean" element in this document defines a JavaBean. |
13 |
Typically the bean class is specified, along with JavaBean properties |
14 |
and/or constructor arguments. |
15 |
|
16 |
A bean instance can be a "singleton" (shared instance) or a "prototype" |
17 |
(independent instance). Further scopes can be provided by extended |
18 |
bean factories, for example in a web environment. |
19 |
|
20 |
References among beans are supported, that is, setting a JavaBean property |
21 |
or a constructor argument to refer to another bean in the same factory |
22 |
(or an ancestor factory). |
23 |
|
24 |
As alternative to bean references, "inner bean definitions" can be used. |
25 |
Singleton flags of such inner bean definitions are effectively ignored: |
26 |
Inner beans are typically anonymous prototypes. |
27 |
|
28 |
There is also support for lists, sets, maps, and java.util.Properties |
29 |
as bean property types or constructor argument types. |
30 |
|
31 |
For simple purposes, this DTD is sufficient. As of Spring 2.0, |
32 |
XSD-based bean definitions are supported as more powerful alternative. |
33 |
|
34 |
XML documents that conform to this DTD should declare the following doctype: |
35 |
|
36 |
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" |
37 |
"http://www.springframework.org/dtd/spring-beans-2.0.dtd"> |
38 |
--> |
39 |
|
40 |
|
41 |
<!-- |
42 |
The document root. A document can contain bean definitions only, |
43 |
imports only, or a mixture of both (typically with imports first). |
44 |
--> |
45 |
<!ELEMENT beans ( |
46 |
description?, |
47 |
(import | alias | bean)* |
48 |
)> |
49 |
|
50 |
<!-- |
51 |
Default values for all bean definitions. Can be overridden at |
52 |
the "bean" level. See those attribute definitions for details. |
53 |
--> |
54 |
<!ATTLIST beans default-lazy-init (true | false) "false"> |
55 |
<!ATTLIST beans default-merge (true | false) "false"> |
56 |
<!ATTLIST beans default-autowire (no | byName | byType | constructor | autodetect) "no"> |
57 |
<!ATTLIST beans default-dependency-check (none | objects | simple | all) "none"> |
58 |
<!ATTLIST beans default-init-method CDATA #IMPLIED> |
59 |
<!ATTLIST beans default-destroy-method CDATA #IMPLIED> |
60 |
|
61 |
<!-- |
62 |
Element containing informative text describing the purpose of the enclosing |
63 |
element. Always optional. |
64 |
Used primarily for user documentation of XML bean definition documents. |
65 |
--> |
66 |
<!ELEMENT description (#PCDATA)> |
67 |
|
68 |
|
69 |
<!-- |
70 |
Specifies an XML bean definition resource to import. |
71 |
--> |
72 |
<!ELEMENT import EMPTY> |
73 |
|
74 |
<!-- |
75 |
The relative resource location of the XML bean definition file to import, |
76 |
for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml". |
77 |
--> |
78 |
<!ATTLIST import resource CDATA #REQUIRED> |
79 |
|
80 |
|
81 |
<!-- |
82 |
Defines an alias for a bean, which can reside in a different definition file. |
83 |
--> |
84 |
<!ELEMENT alias EMPTY> |
85 |
|
86 |
<!-- |
87 |
The name of the bean to define an alias for. |
88 |
--> |
89 |
<!ATTLIST alias name CDATA #REQUIRED> |
90 |
|
91 |
<!-- |
92 |
The alias name to define for the bean. |
93 |
--> |
94 |
<!ATTLIST alias alias CDATA #REQUIRED> |
95 |
|
96 |
<!-- |
97 |
Allows for arbitrary metadata to be attached to a bean definition. |
98 |
--> |
99 |
<!ELEMENT meta EMPTY> |
100 |
|
101 |
<!-- |
102 |
Specifies the key name of the metadata parameter being defined. |
103 |
--> |
104 |
<!ATTLIST meta key CDATA #REQUIRED> |
105 |
|
106 |
<!-- |
107 |
Specifies the value of the metadata parameter being defined as a String. |
108 |
--> |
109 |
<!ATTLIST meta value CDATA #REQUIRED> |
110 |
|
111 |
<!-- |
112 |
Defines a single (usually named) bean. |
113 |
|
114 |
A bean definition may contain nested tags for constructor arguments, |
115 |
property values, lookup methods, and replaced methods. Mixing constructor |
116 |
injection and setter injection on the same bean is explicitly supported. |
117 |
--> |
118 |
<!ELEMENT bean ( |
119 |
description?, |
120 |
(meta | constructor-arg | property | lookup-method | replaced-method)* |
121 |
)> |
122 |
|
123 |
<!-- |
124 |
Beans can be identified by an id, to enable reference checking. |
125 |
|
126 |
There are constraints on a valid XML id: if you want to reference your bean |
127 |
in Java code using a name that's illegal as an XML id, use the optional |
128 |
"name" attribute. If neither is given, the bean class name is used as id |
129 |
(with an appended counter like "#2" if there is already a bean with that name). |
130 |
--> |
131 |
<!ATTLIST bean id ID #IMPLIED> |
132 |
|
133 |
<!-- |
134 |
Optional. Can be used to create one or more aliases illegal in an id. |
135 |
Multiple aliases can be separated by any number of spaces, commas, or |
136 |
semi-colons (or indeed any mixture of the three). |
137 |
--> |
138 |
<!ATTLIST bean name CDATA #IMPLIED> |
139 |
|
140 |
<!-- |
141 |
Each bean definition must specify the fully qualified name of the class, |
142 |
except if it serves only as a parent definition for child bean definitions. |
143 |
--> |
144 |
<!ATTLIST bean class CDATA #IMPLIED> |
145 |
|
146 |
<!-- |
147 |
Optionally specify a parent bean definition. |
148 |
|
149 |
Will use the bean class of the parent if none specified, but can |
150 |
also override it. In the latter case, the child bean class must be |
151 |
compatible with the parent, i.e. accept the parent's property values |
152 |
and constructor argument values, if any. |
153 |
|
154 |
A child bean definition will inherit constructor argument values, |
155 |
property values and method overrides from the parent, with the option |
156 |
to add new values. If init method, destroy method, factory bean and/or factory |
157 |
method are specified, they will override the corresponding parent settings. |
158 |
|
159 |
The remaining settings will always be taken from the child definition: |
160 |
depends on, autowire mode, dependency check, scope, lazy init. |
161 |
--> |
162 |
<!ATTLIST bean parent CDATA #IMPLIED> |
163 |
|
164 |
<!-- |
165 |
The scope of this bean: typically "singleton" (one shared instance, |
166 |
which will be returned by all calls to getBean() with the id), |
167 |
or "prototype" (independent instance resulting from each call to |
168 |
getBean(). Default is "singleton". |
169 |
|
170 |
Singletons are most commonly used, and are ideal for multi-threaded |
171 |
service objects. Further scopes, such as "request" or "session", |
172 |
might be supported by extended bean factories (for example, in a |
173 |
web environment). |
174 |
|
175 |
Note: This attribute will not be inherited by child bean definitions. |
176 |
Hence, it needs to be specified per concrete bean definition. |
177 |
|
178 |
Inner bean definitions inherit the singleton status of their containing |
179 |
bean definition, unless explicitly specified: The inner bean will be a |
180 |
singleton if the containing bean is a singleton, and a prototype if |
181 |
the containing bean has any other scope. |
182 |
--> |
183 |
<!ATTLIST bean scope CDATA #IMPLIED> |
184 |
|
185 |
<!-- |
186 |
Is this bean "abstract", i.e. not meant to be instantiated itself but |
187 |
rather just serving as parent for concrete child bean definitions. |
188 |
Default is "false". Specify "true" to tell the bean factory to not try to |
189 |
instantiate that particular bean in any case. |
190 |
|
191 |
Note: This attribute will not be inherited by child bean definitions. |
192 |
Hence, it needs to be specified per abstract bean definition. |
193 |
--> |
194 |
<!ATTLIST bean abstract (true | false) #IMPLIED> |
195 |
|
196 |
<!-- |
197 |
If this bean should be lazily initialized. |
198 |
If false, it will get instantiated on startup by bean factories |
199 |
that perform eager initialization of singletons. |
200 |
|
201 |
Note: This attribute will not be inherited by child bean definitions. |
202 |
Hence, it needs to be specified per concrete bean definition. |
203 |
--> |
204 |
<!ATTLIST bean lazy-init (true | false | default) "default"> |
205 |
|
206 |
<!-- |
207 |
Optional attribute controlling whether to "autowire" bean properties. |
208 |
This is an automagical process in which bean references don't need to be coded |
209 |
explicitly in the XML bean definition file, but Spring works out dependencies. |
210 |
|
211 |
There are 5 modes: |
212 |
|
213 |
1. "no" |
214 |
The traditional Spring default. No automagical wiring. Bean references |
215 |
must be defined in the XML file via the <ref> element. We recommend this |
216 |
in most cases as it makes documentation more explicit. |
217 |
|
218 |
2. "byName" |
219 |
Autowiring by property name. If a bean of class Cat exposes a dog property, |
220 |
Spring will try to set this to the value of the bean "dog" in the current factory. |
221 |
If there is no matching bean by name, nothing special happens; |
222 |
use dependency-check="objects" to raise an error in that case. |
223 |
|
224 |
3. "byType" |
225 |
Autowiring if there is exactly one bean of the property type in the bean factory. |
226 |
If there is more than one, a fatal error is raised, and you can't use byType |
227 |
autowiring for that bean. If there is none, nothing special happens; |
228 |
use dependency-check="objects" to raise an error in that case. |
229 |
|
230 |
4. "constructor" |
231 |
Analogous to "byType" for constructor arguments. If there isn't exactly one bean |
232 |
of the constructor argument type in the bean factory, a fatal error is raised. |
233 |
|
234 |
5. "autodetect" |
235 |
Chooses "constructor" or "byType" through introspection of the bean class. |
236 |
If a default constructor is found, "byType" gets applied. |
237 |
|
238 |
The latter two are similar to PicoContainer and make bean factories simple to |
239 |
configure for small namespaces, but doesn't work as well as standard Spring |
240 |
behaviour for bigger applications. |
241 |
|
242 |
Note that explicit dependencies, i.e. "property" and "constructor-arg" elements, |
243 |
always override autowiring. Autowire behavior can be combined with dependency |
244 |
checking, which will be performed after all autowiring has been completed. |
245 |
|
246 |
Note: This attribute will not be inherited by child bean definitions. |
247 |
Hence, it needs to be specified per concrete bean definition. |
248 |
--> |
249 |
<!ATTLIST bean autowire (no | byName | byType | constructor | autodetect | default) "default"> |
250 |
|
251 |
<!-- |
252 |
Optional attribute controlling whether to check whether all this |
253 |
beans dependencies, expressed in its properties, are satisfied. |
254 |
Default is no dependency checking. |
255 |
|
256 |
"simple" type dependency checking includes primitives and String |
257 |
"object" includes collaborators (other beans in the factory) |
258 |
"all" includes both types of dependency checking |
259 |
|
260 |
Note: This attribute will not be inherited by child bean definitions. |
261 |
Hence, it needs to be specified per concrete bean definition. |
262 |
--> |
263 |
<!ATTLIST bean dependency-check (none | objects | simple | all | default) "default"> |
264 |
|
265 |
<!-- |
266 |
The names of the beans that this bean depends on being initialized. |
267 |
The bean factory will guarantee that these beans get initialized before. |
268 |
|
269 |
Note that dependencies are normally expressed through bean properties or |
270 |
constructor arguments. This property should just be necessary for other kinds |
271 |
of dependencies like statics (*ugh*) or database preparation on startup. |
272 |
|
273 |
Note: This attribute will not be inherited by child bean definitions. |
274 |
Hence, it needs to be specified per concrete bean definition. |
275 |
--> |
276 |
<!ATTLIST bean depends-on CDATA #IMPLIED> |
277 |
|
278 |
<!-- |
279 |
Indicates whether or not this bean should be considered when looking |
280 |
for matching candidates to satisfy another bean's autowiring requirements. |
281 |
Note that this does not affect explicit references by name, which will get |
282 |
resolved even if the specified bean is not marked as an autowire candidate. |
283 |
--> |
284 |
<!ATTLIST bean autowire-candidate (true | false) #IMPLIED> |
285 |
|
286 |
<!-- |
287 |
Optional attribute for the name of the custom initialization method |
288 |
to invoke after setting bean properties. The method must have no arguments, |
289 |
but may throw any exception. |
290 |
--> |
291 |
<!ATTLIST bean init-method CDATA #IMPLIED> |
292 |
|
293 |
<!-- |
294 |
Optional attribute for the name of the custom destroy method to invoke |
295 |
on bean factory shutdown. The method must have no arguments, |
296 |
but may throw any exception. |
297 |
|
298 |
Note: Only invoked on beans whose lifecycle is under full control |
299 |
of the factory - which is always the case for singletons, but not |
300 |
guaranteed for any other scope. |
301 |
--> |
302 |
<!ATTLIST bean destroy-method CDATA #IMPLIED> |
303 |
|
304 |
<!-- |
305 |
Optional attribute specifying the name of a factory method to use to |
306 |
create this object. Use constructor-arg elements to specify arguments |
307 |
to the factory method, if it takes arguments. Autowiring does not apply |
308 |
to factory methods. |
309 |
|
310 |
If the "class" attribute is present, the factory method will be a static |
311 |
method on the class specified by the "class" attribute on this bean |
312 |
definition. Often this will be the same class as that of the constructed |
313 |
object - for example, when the factory method is used as an alternative |
314 |
to a constructor. However, it may be on a different class. In that case, |
315 |
the created object will *not* be of the class specified in the "class" |
316 |
attribute. This is analogous to FactoryBean behavior. |
317 |
|
318 |
If the "factory-bean" attribute is present, the "class" attribute is not |
319 |
used, and the factory method will be an instance method on the object |
320 |
returned from a getBean call with the specified bean name. The factory |
321 |
bean may be defined as a singleton or a prototype. |
322 |
|
323 |
The factory method can have any number of arguments. Autowiring is not |
324 |
supported. Use indexed constructor-arg elements in conjunction with the |
325 |
factory-method attribute. |
326 |
|
327 |
Setter Injection can be used in conjunction with a factory method. |
328 |
Method Injection cannot, as the factory method returns an instance, |
329 |
which will be used when the container creates the bean. |
330 |
--> |
331 |
<!ATTLIST bean factory-method CDATA #IMPLIED> |
332 |
|
333 |
<!-- |
334 |
Alternative to class attribute for factory-method usage. |
335 |
If this is specified, no class attribute should be used. |
336 |
This should be set to the name of a bean in the current or |
337 |
ancestor factories that contains the relevant factory method. |
338 |
This allows the factory itself to be configured using Dependency |
339 |
Injection, and an instance (rather than static) method to be used. |
340 |
--> |
341 |
<!ATTLIST bean factory-bean CDATA #IMPLIED> |
342 |
|
343 |
<!-- |
344 |
Bean definitions can specify zero or more constructor arguments. |
345 |
This is an alternative to "autowire constructor". |
346 |
Arguments correspond to either a specific index of the constructor argument |
347 |
list or are supposed to be matched generically by type. |
348 |
|
349 |
Note: A single generic argument value will just be used once, rather than |
350 |
potentially matched multiple times (as of Spring 1.1). |
351 |
|
352 |
constructor-arg elements are also used in conjunction with the factory-method |
353 |
element to construct beans using static or instance factory methods. |
354 |
--> |
355 |
<!ELEMENT constructor-arg ( |
356 |
description?, |
357 |
(bean | ref | idref | value | null | list | set | map | props)? |
358 |
)> |
359 |
|
360 |
<!-- |
361 |
The constructor-arg tag can have an optional index attribute, |
362 |
to specify the exact index in the constructor argument list. Only needed |
363 |
to avoid ambiguities, e.g. in case of 2 arguments of the same type. |
364 |
--> |
365 |
<!ATTLIST constructor-arg index CDATA #IMPLIED> |
366 |
|
367 |
<!-- |
368 |
The constructor-arg tag can have an optional type attribute, |
369 |
to specify the exact type of the constructor argument. Only needed |
370 |
to avoid ambiguities, e.g. in case of 2 single argument constructors |
371 |
that can both be converted from a String. |
372 |
--> |
373 |
<!ATTLIST constructor-arg type CDATA #IMPLIED> |
374 |
|
375 |
<!-- |
376 |
A short-cut alternative to a child element "ref bean=". |
377 |
--> |
378 |
<!ATTLIST constructor-arg ref CDATA #IMPLIED> |
379 |
|
380 |
<!-- |
381 |
A short-cut alternative to a child element "value". |
382 |
--> |
383 |
<!ATTLIST constructor-arg value CDATA #IMPLIED> |
384 |
|
385 |
|
386 |
<!-- |
387 |
Bean definitions can have zero or more properties. |
388 |
Property elements correspond to JavaBean setter methods exposed |
389 |
by the bean classes. Spring supports primitives, references to other |
390 |
beans in the same or related factories, lists, maps and properties. |
391 |
--> |
392 |
<!ELEMENT property ( |
393 |
description?, meta*, |
394 |
(bean | ref | idref | value | null | list | set | map | props)? |
395 |
)> |
396 |
|
397 |
<!-- |
398 |
The property name attribute is the name of the JavaBean property. |
399 |
This follows JavaBean conventions: a name of "age" would correspond |
400 |
to setAge()/optional getAge() methods. |
401 |
--> |
402 |
<!ATTLIST property name CDATA #REQUIRED> |
403 |
|
404 |
<!-- |
405 |
A short-cut alternative to a child element "ref bean=". |
406 |
--> |
407 |
<!ATTLIST property ref CDATA #IMPLIED> |
408 |
|
409 |
<!-- |
410 |
A short-cut alternative to a child element "value". |
411 |
--> |
412 |
<!ATTLIST property value CDATA #IMPLIED> |
413 |
|
414 |
|
415 |
<!-- |
416 |
A lookup method causes the IoC container to override the given method and return |
417 |
the bean with the name given in the bean attribute. This is a form of Method Injection. |
418 |
It's particularly useful as an alternative to implementing the BeanFactoryAware |
419 |
interface, in order to be able to make getBean() calls for non-singleton instances |
420 |
at runtime. In this case, Method Injection is a less invasive alternative. |
421 |
--> |
422 |
<!ELEMENT lookup-method EMPTY> |
423 |
|
424 |
<!-- |
425 |
Name of a lookup method. This method should take no arguments. |
426 |
--> |
427 |
<!ATTLIST lookup-method name CDATA #IMPLIED> |
428 |
|
429 |
<!-- |
430 |
Name of the bean in the current or ancestor factories that the lookup method |
431 |
should resolve to. Often this bean will be a prototype, in which case the |
432 |
lookup method will return a distinct instance on every invocation. This |
433 |
is useful for single-threaded objects. |
434 |
--> |
435 |
<!ATTLIST lookup-method bean CDATA #IMPLIED> |
436 |
|
437 |
|
438 |
<!-- |
439 |
Similar to the lookup method mechanism, the replaced-method element is used to control |
440 |
IoC container method overriding: Method Injection. This mechanism allows the overriding |
441 |
of a method with arbitrary code. |
442 |
--> |
443 |
<!ELEMENT replaced-method ( |
444 |
(arg-type)* |
445 |
)> |
446 |
|
447 |
<!-- |
448 |
Name of the method whose implementation should be replaced by the IoC container. |
449 |
If this method is not overloaded, there's no need to use arg-type subelements. |
450 |
If this method is overloaded, arg-type subelements must be used for all |
451 |
override definitions for the method. |
452 |
--> |
453 |
<!ATTLIST replaced-method name CDATA #IMPLIED> |
454 |
|
455 |
<!-- |
456 |
Bean name of an implementation of the MethodReplacer interface in the current |
457 |
or ancestor factories. This may be a singleton or prototype bean. If it's |
458 |
a prototype, a new instance will be used for each method replacement. |
459 |
Singleton usage is the norm. |
460 |
--> |
461 |
<!ATTLIST replaced-method replacer CDATA #IMPLIED> |
462 |
|
463 |
<!-- |
464 |
Subelement of replaced-method identifying an argument for a replaced method |
465 |
in the event of method overloading. |
466 |
--> |
467 |
<!ELEMENT arg-type (#PCDATA)> |
468 |
|
469 |
<!-- |
470 |
Specification of the type of an overloaded method argument as a String. |
471 |
For convenience, this may be a substring of the FQN. E.g. all the |
472 |
following would match "java.lang.String": |
473 |
- java.lang.String |
474 |
- String |
475 |
- Str |
476 |
|
477 |
As the number of arguments will be checked also, this convenience can often |
478 |
be used to save typing. |
479 |
--> |
480 |
<!ATTLIST arg-type match CDATA #IMPLIED> |
481 |
|
482 |
|
483 |
<!-- |
484 |
Defines a reference to another bean in this factory or an external |
485 |
factory (parent or included factory). |
486 |
--> |
487 |
<!ELEMENT ref EMPTY> |
488 |
|
489 |
<!-- |
490 |
References must specify a name of the target bean. |
491 |
The "bean" attribute can reference any name from any bean in the context, |
492 |
to be checked at runtime. |
493 |
Local references, using the "local" attribute, have to use bean ids; |
494 |
they can be checked by this DTD, thus should be preferred for references |
495 |
within the same bean factory XML file. |
496 |
--> |
497 |
<!ATTLIST ref bean CDATA #IMPLIED> |
498 |
<!ATTLIST ref local IDREF #IMPLIED> |
499 |
<!ATTLIST ref parent CDATA #IMPLIED> |
500 |
|
501 |
|
502 |
<!-- |
503 |
Defines a string property value, which must also be the id of another |
504 |
bean in this factory or an external factory (parent or included factory). |
505 |
While a regular 'value' element could instead be used for the same effect, |
506 |
using idref in this case allows validation of local bean ids by the XML |
507 |
parser, and name completion by supporting tools. |
508 |
--> |
509 |
<!ELEMENT idref EMPTY> |
510 |
|
511 |
<!-- |
512 |
ID refs must specify a name of the target bean. |
513 |
The "bean" attribute can reference any name from any bean in the context, |
514 |
potentially to be checked at runtime by bean factory implementations. |
515 |
Local references, using the "local" attribute, have to use bean ids; |
516 |
they can be checked by this DTD, thus should be preferred for references |
517 |
within the same bean factory XML file. |
518 |
--> |
519 |
<!ATTLIST idref bean CDATA #IMPLIED> |
520 |
<!ATTLIST idref local IDREF #IMPLIED> |
521 |
|
522 |
|
523 |
<!-- |
524 |
Contains a string representation of a property value. |
525 |
The property may be a string, or may be converted to the required |
526 |
type using the JavaBeans PropertyEditor machinery. This makes it |
527 |
possible for application developers to write custom PropertyEditor |
528 |
implementations that can convert strings to arbitrary target objects. |
529 |
|
530 |
Note that this is recommended for simple objects only. |
531 |
Configure more complex objects by populating JavaBean |
532 |
properties with references to other beans. |
533 |
--> |
534 |
<!ELEMENT value (#PCDATA)> |
535 |
|
536 |
<!-- |
537 |
The value tag can have an optional type attribute, to specify the |
538 |
exact type that the value should be converted to. Only needed |
539 |
if the type of the target property or constructor argument is |
540 |
too generic: for example, in case of a collection element. |
541 |
--> |
542 |
<!ATTLIST value type CDATA #IMPLIED> |
543 |
|
544 |
<!-- |
545 |
Denotes a Java null value. Necessary because an empty "value" tag |
546 |
will resolve to an empty String, which will not be resolved to a |
547 |
null value unless a special PropertyEditor does so. |
548 |
--> |
549 |
<!ELEMENT null (#PCDATA)> |
550 |
|
551 |
|
552 |
<!-- |
553 |
A list can contain multiple inner bean, ref, collection, or value elements. |
554 |
Java lists are untyped, pending generics support in Java 1.5, |
555 |
although references will be strongly typed. |
556 |
A list can also map to an array type. The necessary conversion |
557 |
is automatically performed by the BeanFactory. |
558 |
--> |
559 |
<!ELEMENT list ( |
560 |
(bean | ref | idref | value | null | list | set | map | props)* |
561 |
)> |
562 |
|
563 |
<!-- |
564 |
Enable/disable merging for collections when using parent/child beans. |
565 |
--> |
566 |
<!ATTLIST list merge (true | false | default) "default"> |
567 |
|
568 |
<!-- |
569 |
Specify the default Java type for nested values. |
570 |
--> |
571 |
<!ATTLIST list value-type CDATA #IMPLIED> |
572 |
|
573 |
|
574 |
<!-- |
575 |
A set can contain multiple inner bean, ref, collection, or value elements. |
576 |
Java sets are untyped, pending generics support in Java 1.5, |
577 |
although references will be strongly typed. |
578 |
--> |
579 |
<!ELEMENT set ( |
580 |
(bean | ref | idref | value | null | list | set | map | props)* |
581 |
)> |
582 |
|
583 |
<!-- |
584 |
Enable/disable merging for collections when using parent/child beans. |
585 |
--> |
586 |
<!ATTLIST set merge (true | false | default) "default"> |
587 |
|
588 |
<!-- |
589 |
Specify the default Java type for nested values. |
590 |
--> |
591 |
<!ATTLIST set value-type CDATA #IMPLIED> |
592 |
|
593 |
|
594 |
<!-- |
595 |
A Spring map is a mapping from a string key to object. |
596 |
Maps may be empty. |
597 |
--> |
598 |
<!ELEMENT map ( |
599 |
(entry)* |
600 |
)> |
601 |
|
602 |
<!-- |
603 |
Enable/disable merging for collections when using parent/child beans. |
604 |
--> |
605 |
<!ATTLIST map merge (true | false | default) "default"> |
606 |
|
607 |
<!-- |
608 |
Specify the default Java type for nested entry keys. |
609 |
--> |
610 |
<!ATTLIST map key-type CDATA #IMPLIED> |
611 |
|
612 |
<!-- |
613 |
Specify the default Java type for nested entry values. |
614 |
--> |
615 |
<!ATTLIST map value-type CDATA #IMPLIED> |
616 |
|
617 |
<!-- |
618 |
A map entry can be an inner bean, ref, value, or collection. |
619 |
The key of the entry is given by the "key" attribute or child element. |
620 |
--> |
621 |
<!ELEMENT entry ( |
622 |
key?, |
623 |
(bean | ref | idref | value | null | list | set | map | props)? |
624 |
)> |
625 |
|
626 |
<!-- |
627 |
Each map element must specify its key as attribute or as child element. |
628 |
A key attribute is always a String value. |
629 |
--> |
630 |
<!ATTLIST entry key CDATA #IMPLIED> |
631 |
|
632 |
<!-- |
633 |
A short-cut alternative to a "key" element with a "ref bean=" child element. |
634 |
--> |
635 |
<!ATTLIST entry key-ref CDATA #IMPLIED> |
636 |
|
637 |
<!-- |
638 |
A short-cut alternative to a child element "value". |
639 |
--> |
640 |
<!ATTLIST entry value CDATA #IMPLIED> |
641 |
|
642 |
<!-- |
643 |
A short-cut alternative to a child element "ref bean=". |
644 |
--> |
645 |
<!ATTLIST entry value-ref CDATA #IMPLIED> |
646 |
|
647 |
<!-- |
648 |
A key element can contain an inner bean, ref, value, or collection. |
649 |
--> |
650 |
<!ELEMENT key ( |
651 |
(bean | ref | idref | value | null | list | set | map | props) |
652 |
)> |
653 |
|
654 |
|
655 |
<!-- |
656 |
Props elements differ from map elements in that values must be strings. |
657 |
Props may be empty. |
658 |
--> |
659 |
<!ELEMENT props ( |
660 |
(prop)* |
661 |
)> |
662 |
|
663 |
<!-- |
664 |
Enable/disable merging for collections when using parent/child beans. |
665 |
--> |
666 |
<!ATTLIST props merge (true | false | default) "default"> |
667 |
|
668 |
<!-- |
669 |
Element content is the string value of the property. |
670 |
Note that whitespace is trimmed off to avoid unwanted whitespace |
671 |
caused by typical XML formatting. |
672 |
--> |
673 |
<!ELEMENT prop (#PCDATA)> |
674 |
|
675 |
<!-- |
676 |
Each property element must specify its key. |
677 |
--> |
678 |
<!ATTLIST prop key CDATA #REQUIRED> |
679 |
|