blob: aa143520196a96e17935bee3993e6128d7d59a17 [file] [log] [blame]
rymandd3eac92005-01-12 02:20:13 +00001<?xml version="1.0" encoding="UTF-8"?>
ryman22c246e2005-01-20 12:03:04 +00002<!-- Version: $Id: component.xsd,v 1.2 2005/01/20 12:03:03 ryman Exp $ -->
rymandd3eac92005-01-12 02:20:13 +00003
4<!--
5 Copyright (c) 2005 IBM Corp.
6 All rights reserved. This program and the accompanying materials
7 are made available under the terms of the Eclipse Public License v1.0
8 which accompanies this distribution, and is available at
9 http://www.eclipse.org/legal/epl-v10.html
10
11 Contributors:
12 Jim des Rivieres <Jim_des_Rivieres@ca.ibm.com>
13 Arthur Ryman <ryman@ca.ibm.com>
14
15 ChangeLog:
16
17 2005-01-11: Arthur Ryman <ryman@ca.ibm.com>
18 - created from Jim des Rivieres' api-usage-checking-design.html
19
20-->
21
22<schema xmlns="http://www.w3.org/2001/XMLSchema"
23 targetNamespace="http://eclipse.org/component"
24 xmlns:tns="http://eclipse.org/component">
25 <annotation>
26 <documentation>
27 Each component is described via a component description
28 file.
29 </documentation>
30 </annotation>
31 <element name="component">
32 <annotation>
33 <documentation>
34 Provides information about a component. Child elements
35 of this element describe the set of plug-ins and
36 fragments making up the component, and provide
37 information about the Java packages and types in the
38 component's code.
39 </documentation>
40 </annotation>
41 <complexType>
42 <sequence>
43 <element ref="tns:plugin" minOccurs="0"
44 maxOccurs="unbounded">
45 </element>
46 <element ref="tns:package" minOccurs="0"
47 maxOccurs="unbounded">
48 </element>
ryman22c246e2005-01-20 12:03:04 +000049 <element ref="tns:component-depends" minOccurs="1"
50 maxOccurs="1">
51 </element>
rymandd3eac92005-01-12 02:20:13 +000052 </sequence>
53 <attribute name="name" type="string" use="required">
54 <annotation>
55 <documentation>
56 The component name; e.g. "Eclipse Platform
57 Generic Workbench"; note that this name is used
58 to refer to the component and distinguish it
59 from other components (but otherwise has no
60 official status in Eclipse ontology)
61 </documentation>
62 </annotation>
63 </attribute>
64 </complexType>
65 <unique name="plugin-id">
66 <annotation>
67 <documentation>
68 Each &lt;plugin&gt; element must identify a distinct
69 plug-in or fragment.
70 </documentation>
71 </annotation>
72 <selector xpath="plugin" />
73 <field xpath="@id"></field>
74 </unique>
75 <unique name="package-name">
76 <annotation>
77 <documentation>
78 Each &lt;package&gt; element must identify a
79 distinct package relative to that component.
80 </documentation>
81 </annotation>
82 <selector xpath="package" />
83 <field xpath="@name"></field>
84 </unique>
85 </element>
86
87 <element name="plugin">
88 <annotation>
89 <documentation>
90 Identifies a plug-in or plug-in fragment that is part of
91 the component. The list of plug-ins must be complete;
92 that is, a component contains a plug-in (or fragment) if
93 and only if a &lt;plugin&gt; element occurs as a child
94 of the &lt;component&gt; element.
95 </documentation>
96 </annotation>
97 <complexType>
98 <attribute name="id" type="string" use="required">
99 <annotation>
100 <documentation>
101 The plug-in id or plug-in fragment id; e.g.,
102 "org.eclipse.core.resources"; note that in the
103 case of a fragment, this is the id of fragment
104 itself.
105 </documentation>
106 </annotation>
107 </attribute>
108 <attribute name="fragment" type="boolean" default="false">
109 <annotation>
110 <documentation>
111 State whether this is a plug-in fragment as
112 opposed to a plug-in (default: plug-in).
113 </documentation>
114 </annotation>
115 </attribute>
116 </complexType>
117 </element>
118
119 <element name="package">
120 <annotation>
121 <documentation>
122 Provides information about a package as used by the
123 component. In the unusual case where a package is shared
124 with other components, the &lt;package&gt; element is
125 understood to apply only to the types the component
126 actually declares, and has no bearing on the types
127 declared in the same package in any other component. The
128 list of packages may be incomplete; if the component
129 contains code in a package not mentioned in the list,
130 the package is considered to be internal (equivalent to
131 being explicitly described as &lt;package name="..."
132 api="false" /&gt;). The children of the &lt;package&gt;
133 element provide information about specific types in the
134 package.
135 </documentation>
136 </annotation>
137 <complexType>
138 <sequence>
139 <element ref="tns:type" minOccurs="0"
140 maxOccurs="unbounded">
141 </element>
142 </sequence>
143 <attribute name="name" type="string" use="required">
144 <annotation>
145 <documentation>
146 Java package name; e.g., "javax.swing",
147 "org.eclipse.ui".
148 </documentation>
149 </annotation>
150 </attribute>
151 <attribute name="exclusive" type="boolean" default="true">
152 <annotation>
153 <documentation>
154 States whether top-level types in this package
155 are API types by default (default: true);
156 specify "false" in order to explicitly list API
157 types found in the package.
158 </documentation>
159 </annotation>
160 </attribute>
161 <attribute name="api" type="boolean" default="true">
162 <annotation>
163 <documentation>
164 States whether this package is reserved for
165 exclusive use by this component (default: true);
166 specify "false" in (rare) cases where a multiple
167 components declared types in the same package.
168 Package sharing is only by mutual consent; all
169 components involved must explicitly declare the
170 package as exclusive="false" (even if it has no
171 API types).
172 </documentation>
173 </annotation>
174 </attribute>
175 </complexType>
176 <unique name="type-name">
177 <annotation>
178 <documentation>
179 Each &lt;type&gt; element must identify a distinct
180 name relative to that package.
181 </documentation>
182 </annotation>
183 <selector xpath="type" />
184 <field xpath="@name"></field>
185 </unique>
186 </element>
187
188 <element name="type">
189 <annotation>
190 <documentation>
191 Provides information about a top-level type in a
192 package. (Note: We could extend the schema in the future
193 to allow &lt;type&gt; elements to provide analogous
194 information about their members. We could also extend
195 the &lt;component&gt; element to allow aspects other
196 than code API to be described.)
197 </documentation>
198 </annotation>
199 <complexType>
200 <attribute name="name" type="string" use="required">
201 <annotation>
202 <documentation>
203 Simple name of a top-level Java class,
204 interface, enumeration, or annotation type;
205 e.g., "String", "IResource".
206 </documentation>
207 </annotation>
208 </attribute>
209 <attribute name="reference" type="boolean" default="true">
210 <annotation>
211 <documentation>
212 States whether other components are expected to
213 reference this type by name (default: true);
214 specify "false" to indicate that the type is
215 internal.
216 </documentation>
217 </annotation>
218 </attribute>
219 <attribute name="implement" type="boolean" default="true">
220 <annotation>
221 <documentation>
222 States whether other components are expected to
223 declare a class that implements this interface
224 (default: true); specify "false" for an
225 interface that other components are not supposed
226 to implement directly; this attribute is ignored
227 for classes, enumerations, and annotation types,
228 none of which can be meaningfully implemented.
229 </documentation>
230 </annotation>
231 </attribute>
232 <attribute name="subclass" type="boolean" default="true">
233 <annotation>
234 <documentation>
235 States whether other components are expected to
236 declare a class that directly subclasses this
237 class (default: true); specify "false" for a
238 class that other components are not supposed to
239 subclass directly; this attribute is ignored for
240 interfaces, enumerations, and annotation types,
241 none of which can be meaningfully subclassed.
242 </documentation>
243 </annotation>
244 </attribute>
245 <attribute name="instantiate" type="boolean"
246 default="true">
247 <annotation>
248 <documentation>
249 States whether other components are expected to
250 create instances of this class or annotation
251 type (default: true); specify "false" for a type
252 that other components are not supposed to
253 instantiate directly; this attribute is ignored
254 for interfaces and enumerations, neither of
255 which can be meaningfully instantiated; this
256 attribute is moot for classes that are declared
257 final (or ones with no generally accessible
258 constructors), since the Java compiler and JRE
259 will block outside attempts to instantiate.
260 </documentation>
261 </annotation>
262 </attribute>
263 </complexType>
264 </element>
265
ryman22c246e2005-01-20 12:03:04 +0000266 <element name="component-depends">
267 <complexType>
268 <sequence>
269 <element ref="tns:component-ref" minOccurs="0"
270 maxOccurs="unbounded" />
271 </sequence>
272 <attribute name="unrestricted" type="boolean"
273 default="false">
274 <annotation>
275 <documentation>
276 States whether this component is allowed to
277 depend on arbitrary other components, or just
278 the ones explicitly named by the
279 &lt;component-ref&gt; children
280 </documentation>
281 </annotation>
282 </attribute>
283 </complexType>
284 </element>
285
286 <element name="component-ref">
287 <complexType>
288 <attribute name="name" type="string" use="required">
289 <annotation>
290 <documentation>
291 Name of the referenced component; e.g., "Eclipse
292 Platform Generic Workbench"
293 </documentation>
294 </annotation>
295 </attribute>
296 </complexType>
297 </element>
298
rymandd3eac92005-01-12 02:20:13 +0000299</schema>