Skip to main content
summaryrefslogtreecommitdiffstats
blob: db9cb38863989e792e500d58f1ff773e71562c6b (plain) (blame)
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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<!--
  Copyright (c) 2010, 2013 Oracle. All rights reserved.
  This program and the accompanying materials are made available under the
  terms of the Eclipse Public License v1.0, which accompanies this distribution
  and is available at http://www.eclipse.org/legal/epl-v10.html

  Contributors: 
    Oracle - initial API and implementation
 -->

<plugin>
	
	<!-- ***** extension points ***** -->
	
	<extension-point
		id="jaxbPlatforms"
		name="%JAXB_PLATFORMS"
		schema="schema/jaxbPlatforms.exsd"/>
	
	<!-- ***** expressions ***** -->

	<extension point="org.eclipse.core.expressions.definitions">
		<!-- A test for determining whether something adapts to an IProject and has the JAXB facet.
			Force activation of the wst facet plug-in containing the property tester.
			Possible usage:
			<adapt type="org.eclipse.core.resources.IProject">
				<reference definitionId="org.eclipse.jpt.jaxb.reference.hasJaxbFacet"/>
			</adapt>
		-->			
		<definition id="org.eclipse.jpt.jaxb.reference.hasJaxbFacet">
			<test
				property="org.eclipse.wst.common.project.facet.core.projectFacet"
				value="jpt.jaxb"
				forcePluginActivation="true"/>
		</definition>
		
	</extension>
	
	<!-- ***** adapters ***** -->

	<extension
		point="org.eclipse.core.runtime.adapters">

		<!-- IWorkspace -> JaxbWorkspace -->
		<factory
			adaptableType="org.eclipse.core.resources.IWorkspace"
			class="org.eclipse.jpt.jaxb.core.internal.WorkspaceAdapterFactory">
			<adapter type="org.eclipse.jpt.jaxb.core.JaxbWorkspace"/>
		</factory>

		<!-- IResource -> JaxbPlatformConfig -->
		<factory
			class="org.eclipse.jpt.jaxb.core.internal.ResourceAdapterFactory"
			adaptableType="org.eclipse.core.resources.IResource">
			<adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformConfig"/>
		</factory>

		<!-- IJavaElement -> JaxbPlatformConfig -->
		<factory
			class="org.eclipse.jpt.jaxb.core.internal.JavaElementAdapterFactory"
			adaptableType="org.eclipse.jdt.core.IJavaElement">
			<adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformConfig"/>
		</factory>
		
		<!-- IPackageFragment -> JaxbPackage -->
		<factory
			class="org.eclipse.jpt.jaxb.core.internal.context.PackageFragmentAdapterFactory"
			adaptableType="org.eclipse.jdt.core.IPackageFragment">
			<adapter type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"/>
		</factory>
		
		<!-- JaxbPackage -> IPackageFragment -->
		<factory
			class="org.eclipse.jpt.jaxb.core.internal.context.JaxbPackageAdapterFactory"
			adaptableType="org.eclipse.jpt.jaxb.core.context.JaxbPackage">
			<adapter type="org.eclipse.jdt.core.IPackageFragment"/>
		</factory>
		
		<!-- JavaType -> IPackageFragment -->
		<factory
			class="org.eclipse.jpt.jaxb.core.internal.context.JavaTypeAdapterFactory"
			adaptableType="org.eclipse.jpt.jaxb.core.context.java.JavaType">
			<adapter type="org.eclipse.jdt.core.IPackageFragment"/>
		</factory>
		
		<!-- JaxbLibraryProviderInstallOperationConfigAdapterFactory -> JaxbPlatformConfig -->
		<factory
			class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbLibraryProviderInstallOperationConfigAdapterFactory"
			adaptableType="org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig">
			<adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformConfig"/>
		</factory>

	</extension>


	<!-- ***** content types ***** -->
	
	<extension
		point="org.eclipse.core.contenttype.contentTypes">
		
		<content-type
			id="org.eclipse.jpt.jaxb.core.content.jaxbIndex"
			name="%JAXB_INDEX_CONTENT"
			base-type="org.eclipse.core.runtime.text"
			priority="high"
			file-names="jaxb.index"/>
		
		<content-type
			id="org.eclipse.jpt.jaxb.core.content.jaxbProperties"
			name="%JAXB_PROPERTIES_CONTENT"
			base-type="org.eclipse.jdt.core.javaProperties"
			priority="high"
			file-names="jaxb.properties"/>
		
		<!-- 
			abstract XML file content type for use by extenders
	 	-->
		<content-type
			id="org.eclipse.jpt.jaxb.core.content.jaxbXmlContent"
			name="%JAXB_XML_CONTENT"
			base-type="org.eclipse.core.runtime.xml"
			describer="org.eclipse.jpt.common.core.internal.bundleexclude.IndeterminateContentDescriber"/>
		
		<!-- 
			we don't use this file type internally, but we register it here to help 
			those users who do like to configure it for jaxb class generation 
		-->
		<file-association
			content-type="org.eclipse.core.runtime.xml"
			file-extensions="xjb"/>
		
	</extension>
	

	<!-- ***** property testers ***** -->
	
	<extension 
		point="org.eclipse.core.expressions.propertyTesters">

		<propertyTester
			id="org.eclipse.jpt.jaxb.core.propertyTester.JaxbPlatform"
			type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformConfig"
			namespace="org.eclipse.jpt.jaxb.core"
			properties="jaxbPlatform, jaxbPlatformGroup"
			class="org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformPropertyTester"/>
		
		<propertyTester
			id="org.eclipse.jpt.jaxb.core.propertyTester.JaxbPackage"
			type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"
			namespace="org.eclipse.jpt.jaxb.core"
			properties="hasPackageInfo"
			class="org.eclipse.jpt.jaxb.core.internal.context.JaxbPackagePropertyTester"/>
		
	</extension>
			

	<!-- ***** preferences ***** -->

	<extension
		point="org.eclipse.core.runtime.preferences">

		<initializer class="org.eclipse.jpt.jaxb.core.internal.JaxbPreferenceInitializer"/>

	</extension>


	<!-- ***** markers ***** -->
	<!--
	***	Do NOT qualify the marker id with "org.eclipse.jpt.jaxb.core".
	*** See bug 252891.
	-->
	<extension
		point="org.eclipse.core.resources.markers"
		id="problem" 
		name="%JAXB_PROBLEM_MARKER">

		<persistent value="true"/>
		
		<!-- Can't use text marker until we have specific models for each input type (XML, java)
		<super type="org.eclipse.core.resources.textmarker"/>
		-->
		
		<super type="org.eclipse.wst.validation.problemmarker2"/>
		<super type="org.eclipse.jdt.core.problem"/>
	</extension>


	<!-- ***** Dali extensions (eat our own dogfood) ***** -->

	<extension
		point="org.eclipse.jpt.jaxb.core.jaxbPlatforms">
		
		<jaxbPlatformGroup
        	id="generic"
        	label="%GENERIC_PLATFORM_GROUP_LABEL"/>
		
		<jaxbPlatform
			id="generic_2_1"
			label="%GENERIC_2_1_PLATFORM_LABEL"
			factoryClass="org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinitionFactory"
			group="generic"
			jaxbFacetVersion="2.1"
			default="false"/>

		<jaxbPlatform
       	 	id="generic_2_2"
       	 	label="%GENERIC_2_2_PLATFORM_LABEL"
       	 	factoryClass="org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinitionFactory"
        	group="generic"
        	jaxbFacetVersion="2.2"
        	default="false"/>
		
	</extension>
	
	
	<extension
		point="org.eclipse.jpt.common.core.libraryValidators">
		
		<libraryValidator
			id="jaxbJreLibraryValidator"
			class="org.eclipse.jpt.jaxb.core.internal.libval.JaxbJreLibraryValidator">
			<enablement>
				<with variable="libraryProvider">
					<test property="org.eclipse.jpt.common.core.extendsId"
						value="jaxb-jre-library-provider"/>
				</with>
			</enablement>
		</libraryValidator>
		
		<libraryValidator
			id="genericJaxbUserLibraryValidator"
			class="org.eclipse.jpt.jaxb.core.internal.libval.GenericJaxbUserLibraryValidator">
			<enablement>
				<with variable="libraryProvider">
					<test property="org.eclipse.jpt.common.core.extendsId"
						value="jaxb-user-library-provider"/>
				</with>
			</enablement>
		</libraryValidator>
		
		<!--
		<libraryValidator
			id="genericEclipselinkBundlesLibraryValidator"
			class="org.eclipse.jpt.core.internal.libval.GenericEclipseLinkBundlesLibraryValidator">
			<enablement>
				<with variable="libraryProvider">
					<test property="org.eclipse.jpt.core.extendsId"
						value="eclipselink-bundles-library-provider"/>
				</with>
			</enablement>
		</libraryValidator>
		-->
		
	</extension>
	
	
	<extension 
		point="org.eclipse.jst.common.project.facet.core.libraryProviders">
		
		<provider
			id="jaxb-no-op-library-provider"
			extends="jpt-no-op-library-provider">
			<param name="message" value="%JAXB_NO_OP_LIBRARY_PROVIDER_MESSAGE"/>
			<enablement>
				<with variable="requestingProjectFacet">
					<test 
						property="org.eclipse.wst.common.project.facet.core.projectFacet" 
						value="jpt.jaxb" forcePluginActivation="true"/>
				</with>
			</enablement>
		</provider>
		
		<provider
			id="jaxb-jre-library-provider">
			<label>%JAXB_JRE_LIBRARY_PROVIDER_LABEL</label>
			<priority>900</priority>
			<param name="message" value="%JAXB_JRE_LIBRARY_PROVIDER_MESSAGE"/>
      		<enablement>
      			<and>
					<with variable="requestingProjectFacet">
						<test property="org.eclipse.wst.common.project.facet.core.projectFacet" 
							value="jpt.jaxb" forcePluginActivation="true"/>
					</with>
				</and>
			</enablement>
			<action type="INSTALL">
				<config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbJreLibraryProviderInstallOperationConfig"/>
				<operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
			</action>
			<action type="UNINSTALL">
				<operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
			</action>
		</provider>
		
		<provider
			id="jaxb-user-library-provider"
			extends="wtp-user-library-provider">
			<enablement>
				<with variable="requestingProjectFacet">
					<test property="org.eclipse.wst.common.project.facet.core.projectFacet" 
						value="jpt.jaxb" forcePluginActivation="true"/>
				</with>
			</enablement>
			<action type="INSTALL">
				<config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig"/>
				<operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperation"/>
			</action>
		</provider>
		
		<!--
		<provider 
			id="jaxb-osgi-bundles-library-provider"
			extends="wtp-osgi-bundles-library-provider"
			abstract="true">
			<enablement>
				<with variable="requestingProjectFacet">
					<test property="org.eclipse.wst.common.project.facet.core.projectFacet" 
						value="jpt.jaxb" forcePluginActivation="true"/>
				</with>
			</enablement>
			<action type="INSTALL">
				<config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbOsgiBundlesLibraryProviderInstallOperationConfig"/>
				<operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperation"/>
			</action>
		</provider>
		
		<provider
			id="jaxb-eclipselink-bundles-library-provider"
			extends="jaxb-osgi-bundles-library-provider"
			abstract="true"/>
		-->
		
	</extension>


	<!-- ***** WTP facet framework ***** -->

	<extension 
		point="org.eclipse.wst.common.project.facet.core.runtimes">
		
		<supported>
			<facet id="jpt.jaxb"/>
			<runtime-component any="true"/>
		</supported>
		
	</extension>
	
	
	<extension
		point="org.eclipse.wst.common.project.facet.core.facets">
		
		<project-facet id="jpt.jaxb">
			<label>%JAXB_FACET_LABEL</label>
			<description>%JAXB_FACET_DESCRIPTION</description>
		</project-facet>
		
		<project-facet-version facet="jpt.jaxb" version="2.1">
			<constraint>
				<requires facet="java" version="[5.0"/>
			</constraint>
		</project-facet-version>
		
		<project-facet-version facet="jpt.jaxb" version="2.2">
			<constraint>
				<requires facet="java" version="[5.0"/>
			</constraint>
		</project-facet-version>
		
		<template id="jpt.jaxb.template">
			<label>%JAXB_TEMPLATE_LABEL</label>
			<fixed facet="jpt.jaxb"/>
			<fixed facet="java"/>
		</template>
		
		<action facet="jpt.jaxb" type="install" id="jpt.jaxb.install">
			<config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProvider"/>
			<delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDelegate"/>
		</action>
		
		<action facet="jpt.jaxb" type="version-change" id="jpt.jaxb.version-change">
			<config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProvider"/>
			<delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDelegate"/>
		</action>
		
		<action facet="jpt.jaxb" type="uninstall" id="jpt.jaxb.uninstall">
			<delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetUninstallDelegate"/>
		</action>
		
	</extension>
	

	<!-- ***** WTP validation framework ***** -->

	<extension
		point="org.eclipse.wst.validation.validatorV2"
		id="jaxbValidator"
		name="%JAXB_VALIDATOR">
		
		<validator
        	class="org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidator"
        	markerId="org.eclipse.jpt.jaxb.core.problem">
			<include>
				<rules>
					<facet id="jpt.jaxb"/>
				</rules>
			</include>
			<include>
				<rules>
					<contentType id="org.eclipse.jdt.core.javaSource" exactMatch="false"/>
					<contentType id="org.eclipse.jpt.core.content.javaPackageInfo" exactMatch="false"/>
					<contentType id="org.eclipse.jpt.jaxb.core.content.jaxbIndex" exactMatch="false"/>
					<contentType id="org.eclipse.jpt.jaxb.core.content.jaxbProperties" exactMatch="false"/>
					<contentType id="org.eclipse.jpt.jaxb.core.content.jaxbXmlContent" exactMatch="false"/>
					<contentType id="org.eclipse.jpt.common.core.content.projectFacet" exactMatch="true"/>
				</rules>
			</include>
		</validator>
		
	</extension>
		
</plugin>

Back to the top