This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure_10_0.dtd
327 lines (254 loc) · 11.8 KB
/
configure_10_0.dtd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This is the document type descriptor for the
org.eclipse.jetty.xml.XmlConfiguration class. It allows a java object to be
configured by with a sequence of Set, Put and Call elements. These tags are
mapped to methods on the object to be configured as follows:
<Set name="Test">value</Set> == obj.setTest("value");
<Put name="Test">value</Put> == obj.put("Test","value");
<Call name="test"><Arg>value</Arg></Call> == obj.test("value");
Values themselves may be configured objects that are created with the
<New> tag or returned from a <Call> tag.
Values are matched to arguments on a best effort approach, but types
my be specified if a match is not achieved.
-->
<!ENTITY % CONFIG "Set|Get|Put|Call|New|Ref|Array|Map|Property">
<!ENTITY % VALUE "#PCDATA|Get|Call|New|Ref|Array|Map|SystemProperty|Env|Property">
<!ENTITY % TYPE_ATTR "type CDATA #IMPLIED " >
<!ENTITY % CLASS_ATTR "class CDATA #IMPLIED" >
<!ENTITY % NAME_ATTR_REQUIRED "name CDATA #REQUIRED" >
<!ENTITY % NAME_ATTR "name CDATA #IMPLIED" >
<!ENTITY % PROPERTY_ATTR "property CDATA #IMPLIED" >
<!ENTITY % DEPRECATED_ATTR "deprecated CDATA #IMPLIED" >
<!ENTITY % DEFAULT_ATTR "default CDATA #IMPLIED" >
<!ENTITY % ID_ATTR "id ID #IMPLIED" >
<!ENTITY % ARG_ATTR "arg CDATA #IMPLIED" >
<!ENTITY % ITEM_ATTR "item CDATA #IMPLIED" >
<!ENTITY % REF_ATTR "refid CDATA #IMPLIED" >
<!ENTITY % ID_ATTR_REQUIRED "id ID #REQUIRED" >
<!--
Configure Element.
This is the root element that specifies the class of object that
can be configured:
<Configure class="com.acme.MyClass"> ... </Configure>
-->
<!ELEMENT Configure (Id?,Class?,Arg*,(%CONFIG;)*) >
<!ATTLIST Configure %ID_ATTR; %CLASS_ATTR; >
<!--
Set Element.
This element maps to a call to a setter method or field on the current object.
The name and optional type attributes are used to select the setter
method. If the name given is xxx, then a setXxx method is used, or
the xxx field is used of setXxx cannot be found.
A Set element can contain value text and/or the value objects returned
by other elements such as Call, New, SystemProperty, etc.
If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.
If the property attribute is set to a property name, then the set is
performed only if the property has a non null value. If the Set element
contains no value then the the property attribute value is used as the set
value.
A Set with a class attribute is treated as a static set method invocation.
-->
<!ELEMENT Set (%VALUE;)* >
<!ATTLIST Set %ID_ATTR; %CLASS_ATTR; %NAME_ATTR_REQUIRED; %TYPE_ATTR; %PROPERTY_ATTR;>
<!--
Get Element.
This element maps to a call to a getter method or field on the current object.
The name attribute is used to select the get method.
If the name given is xxx, then a getXxx method is used, or
the xxx field is used if getXxx cannot be found.
A Get element can contain other elements such as Set, Put, Call, etc.
which act on the object returned by the get call.
A Get with a class attribute is treated as a static get method or field.
-->
<!ELEMENT Get (Id?,Name?,Class?,(%CONFIG;)*) >
<!ATTLIST Get %ID_ATTR; %NAME_ATTR; %CLASS_ATTR; >
<!--
Put Element.
This element maps to a call to a put method on the current object,
which must implement the Map interface. The name attribute is used
as the put key and the optional type attribute can force the type
of the value.
A Put element can contain value text and/or value elements such as Call,
New, SystemProperty, etc. If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.
-->
<!ELEMENT Put (%VALUE;)* >
<!ATTLIST Put %NAME_ATTR_REQUIRED; %TYPE_ATTR; >
<!--
Id Element.
This element is the equivalent of the id attribute.
-->
<!ELEMENT Id (%VALUE;)* >
<!--
Name element.
This element is the equivalent of the name attribute.
-->
<!ELEMENT Name (%VALUE;)* >
<!--
Deprecated element.
This element is the equivalent of the deprecated attribute.
-->
<!ELEMENT Deprecated (%VALUE;)* >
<!--
Default element.
This element is the equivalent of the default attribute.
-->
<!ELEMENT Default (%VALUE;)* >
<!--
Class element.
This element is the equivalent of the class attribute.
-->
<!ELEMENT Class (%VALUE;)* >
<!--
Type element.
This element is the equivalent of the type attribute.
-->
<!ELEMENT Type (%VALUE;)* >
<!--
Call Element.
This element maps to an arbitrary call to a method on the current object,
The name attribute and Arg elements are used to select the method.
A Call element can contain a sequence of Arg elements followed by
a sequence of other elements such as Set, Put, Call, etc. which act on any object
returned by the original call:
<Call id="o2" name="test">
<Arg>value1</Arg>
<Set name="Test">Value2</Set>
</Call>
This is equivalent to:
Object o2 = o1.test("value1");
o2.setTest("value2");
A Call with a class attribute is treated as a static call.
-->
<!ELEMENT Call (Id?,Name?,Class?,Arg*,(%CONFIG;)*) >
<!ATTLIST Call %ID_ATTR; %NAME_ATTR; %CLASS_ATTR; %ARG_ATTR; >
<!--
Arg Element.
This element defines a positional or optional named argument for the
Call and New elements. The optional type attribute can force the type
of the value.
An Arg element can contain value text and/or value elements such as Call,
New, SystemProperty, etc. If no value type is specified, then white
space is trimmed out of the value. If it contains multiple value
elements they are added as strings before being converted to any
specified type.
-->
<!ELEMENT Arg (%VALUE;)* >
<!ATTLIST Arg %NAME_ATTR; %TYPE_ATTR; >
<!--
New Element.
This element allows the creation of a new object as part of a
value for elements such as Set, Put, Arg, etc. The class attribute
determines the type of the new object and the contained Arg elements
are used to select the constructor for the new object.
A New element can contain a sequence of Arg elements followed by
a sequence of elements such as Set, Put, Call, etc. elements
which act on the new object:
<New id="o" class="com.acme.MyClass">
<Arg>value1</Arg>
<Set name="test">Value2</Set>
</New>
This is equivalent to:
Object o = new com.acme.MyClass("value1");
o.setTest("Value2");
-->
<!ELEMENT New (Id?,Class?,Arg*,(%CONFIG;)*) >
<!ATTLIST New %ID_ATTR; %CLASS_ATTR; %ARG_ATTR; >
<!--
Ref Element.
This element allows a previously created object to be referenced by id. The
attribute refid is used to specify the id of another object (the attribute id can
also be used, but it's use is deprecated).
A Ref element can contain a sequence of elements such as Set, Put, Call, etc.
which act on the referenced object.
<Ref refid="myobject">
<Set name="Test">Value2</Set>
</New>
-->
<!ELEMENT Ref (Id?,(%CONFIG;)*) >
<!ATTLIST Ref %ID_ATTR; %REF_ATTR;>
<!--
Array Element.
This element allows the creation of a new array as part of a
value of elements such as Set, Put, Arg, etc. The type attribute determines
the type of the new array and the contained Item elements
are used for each element of the array:
<Array type="java.lang.String">
<Item>value0</Item>
<Item><New class="java.lang.String"><Arg>value1</Arg></New></Item>
</Array>
This is equivalent to:
String[] a = new String[] { "value0", new String("value1") };
-->
<!ELEMENT Array (Id?,Type?,Item*) >
<!ATTLIST Array %ID_ATTR; %TYPE_ATTR; %ITEM_ATTR; >
<!--
Map Element.
This element allows the creation of a new map as part of a
value of elements such as Set, Put, Arg, etc. The type attribute determines
the type of the new array and the contained Item elements
are used for each element of the array:
<Map>
<Entry>
<Item>keyName</Item>
<Item><New class="java.lang.String"><Arg>value1</Arg></New></Item>
</Entry>
</Map>
This is equivalent to:
Map m = new HashMap();
m.put("keyName", new String("value1"));
-->
<!ELEMENT Map (Id?,Class?,Entry*) >
<!ATTLIST Map %ID_ATTR; %CLASS_ATTR; >
<!ELEMENT Entry (Item,Item) >
<!--
Item Element.
This element defines an entry for the Array or Map Entry elements.
The optional type attribute can force the type of the value.
An Item element can contain value text and/or the value object of
elements such as Call, New, SystemProperty, etc. If no value type
is specified, then white space is trimmed out of the value.
If it contains multiple value elements they are added as strings
before being converted to any specified type.
-->
<!ELEMENT Item (%VALUE;)* >
<!ATTLIST Item %ID_ATTR; %TYPE_ATTR; >
<!--
System Property Element.
This element allows JVM System properties to be retrieved as
part of the value of elements such as Set, Put, Arg, etc.
The name attribute specifies the property name and the optional
default argument provides a default value.
<SystemProperty name="Test" default="value" />
This is equivalent to:
System.getProperty("Test","value");
-->
<!ELEMENT SystemProperty (Id?,Name?,Deprecated*,Default?) >
<!ATTLIST SystemProperty %ID_ATTR; %NAME_ATTR; %DEPRECATED_ATTR; %DEFAULT_ATTR; >
<!--
Environment variable Element.
This element allows OS Environment variables to be retrieved as
part of the value of elements such as Set, Put, Arg, etc.
The name attribute specifies the env variable name and the optional
default argument provides a default value.
<Env name="Test" default="value" />
This is equivalent to:
String v=System.getEnv("Test");
if (v==null) v="value";
-->
<!ELEMENT Env (Id?,Name?,Deprecated*,Default?) >
<!ATTLIST Env %ID_ATTR; %NAME_ATTR; %DEPRECATED_ATTR; %DEFAULT_ATTR; >
<!--
Property Element.
This element allows arbitrary properties to be retrieved by name.
The name attribute specifies the property name and the optional
default argument provides a default value.
-->
<!ELEMENT Property (Id?,Name?,Deprecated*,Default?) >
<!ATTLIST Property %ID_ATTR; %NAME_ATTR; %DEPRECATED_ATTR; %DEFAULT_ATTR; >