Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.core')
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath14
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml356
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java1107
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java153
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java92
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java403
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java296
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java82
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java133
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java114
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java121
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java208
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java505
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java169
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java1660
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java143
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java157
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java580
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java149
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java191
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java185
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java124
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java297
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java347
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java482
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java206
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java319
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java268
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java676
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java1127
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java485
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java309
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java141
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java444
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java455
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java131
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java523
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java332
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java488
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java316
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java412
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java292
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java249
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java343
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java316
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java502
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java89
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java118
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java248
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java220
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java359
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java248
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java95
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java67
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java95
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java67
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java278
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java346
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java121
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java304
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java212
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java38
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java93
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java170
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java137
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java253
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java276
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java136
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java139
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java161
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java136
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java236
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java167
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java162
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java81
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java112
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java101
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java228
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java173
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java196
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java381
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java345
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java314
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java122
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java234
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java255
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java161
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java304
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java274
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java169
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java342
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java91
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java158
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java114
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java120
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java97
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java190
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java83
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java150
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java223
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java107
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java233
357 files changed, 0 insertions, 42009 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath
deleted file mode 100644
index 84e5b0b8a4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project
deleted file mode 100644
index 54ea9292fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0569657a4d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:18 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 23f50e58c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,56 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.core;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.402,2.0.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.200,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.wst.xsd.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.core,
- org.eclipse.jpt.jaxb.core.context,
- org.eclipse.jpt.jaxb.core.context.java,
- org.eclipse.jpt.jaxb.core.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.facet;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.gen;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.jaxb21;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.jaxb22;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.libprov;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.platform;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.prefs;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.validation;x-internal:=true,
- org.eclipse.jpt.jaxb.core.libprov,
- org.eclipse.jpt.jaxb.core.platform,
- org.eclipse.jpt.jaxb.core.resource.java,
- org.eclipse.jpt.jaxb.core.resource.jaxbindex,
- org.eclipse.jpt.jaxb.core.resource.jaxbprops,
- org.eclipse.jpt.jaxb.core.xsd
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
deleted file mode 100644
index 30afd4a06d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 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
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = schema/
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml
deleted file mode 100644
index 1bf3de57da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2010 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
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.core">
- <description url=""></description>
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.jpt.jaxb.core" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
deleted file mode 100644
index f5d65fa9c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 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
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Core
-providerName = Eclipse Web Tools Platform
-
-JAXB_PLATFORMS = JAXB Platforms
-
-JAXB_INDEX_CONTENT = JAXB Index File
-JAXB_PROPERTIES_CONTENT = JAXB Properties File
-
-JAXB_PROBLEM_MARKER = JAXB Problem
-
-GENERIC_PLATFORM_GROUP_LABEL = Generic JAXB
-GENERIC_2_2_PLATFORM_LABEL = Generic JAXB 2.2
-GENERIC_2_1_PLATFORM_LABEL = Generic JAXB 2.1
-
-JAXB_FACET_LABEL = JAXB
-JAXB_FACET_DESCRIPTION = Adds support for data binding using the Java Architecture for XML Binding (JAXB).
-JAXB_TEMPLATE_LABEL = JAXB Project
-
-JAXB_NO_OP_LIBRARY_PROVIDER_MESSAGE = The JAXB facet requires a JAXB implementation library to be present on the project classpath. By disabling library configuration, the user takes on the responsibility of ensuring that the classpath is configured appropriately via alternate means.
-
-JAXB_JRE_LIBRARY_PROVIDER_LABEL = JRE
-JAXB_JRE_LIBRARY_PROVIDER_MESSAGE = The project JRE provides the annotations and implementation to support the chosen JAXB platform.
-
-JAXB_VALIDATOR = JAXB Validator
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
deleted file mode 100644
index 6be37f5087..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
+++ /dev/null
@@ -1,356 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2010, 2012 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"/>
-
-
- <!-- ***** adapters ***** -->
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.ResourceAdapterFactory"
- adaptableType="org.eclipse.core.resources.IResource">
- <adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.JavaElementAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IJavaElement">
- <adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"/>
- </factory>
-
- <!-- IPackageFragment -> JaxbPackage -->
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.context.JaxbPackageAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IPackageFragment">
- <adapter type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"/>
- </factory>
-
- <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.JaxbPlatformDescription"/>
- </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"/>
-
- <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.jaxbPlatformDescription"
- type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformTester"/>
-
- <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.JaxbPackageTester"/>
-
- </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="jaxbProblemMarker"
- 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>
- <default-version version="2.1"/>
- </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.jaxbProblemMarker">
- <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.jaxbProperties" exactMatch="false"/>
- </rules>
- </include>
- </validator>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
deleted file mode 100644
index 98fb8d159d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
+++ /dev/null
@@ -1,94 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 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
-################################################################################
-
-NO_JAXB_PROJECT = This project has the JAXB facet, but no JAXB content could be created. See the error log for more details.
-PROJECT_INVALID_LIBRARY_PROVIDER = The currently selected JAXB library provider is invalid.
-PROJECT__UNRESOLVED_SCHEMA = Cannot resolve the schema with location ''{0}''.
-PROJECT__DUPLICATE_NAMESPACE = Duplicate schema library entries with the namespace ''{0}''.
-
-PACKAGE_NO_SCHEMA_FOR_NAMESPACE = There is no schema specified on the project for the namespace ''{0}'' on the package ''{1}''. No schema-specific validation will be performed.
-PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED = The type must be specified for an XML Java type adapter on a package
-XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT = The attribute form default conflicts with what is specified on the schema
-XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT = The element form default conflicts with what is specified on the schema
-
-XML_ENUM__NON_SIMPLE_SCHEMA_TYPE = The type ''{0}'' must be associated with a simple schema type.
-
-XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = The namespace for an anonymous type should not be different from its package
-XML_TYPE__UNSPECIFIED_FACTORY_METHOD = If a factory class is specified, a factory method must also be specified.
-XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR = A class must have a public or protected no-arg constructor, unless a factory class/method is provided or the class is adapted with an XmlAdapter.
-XML_TYPE__DUPLICATE_PROP = Duplicate property ''{0}''.
-XML_TYPE__MISSING_PROP = Missing required property ''{0}''.
-XML_TYPE__NONEXISTENT_PROP = Nonexistent property ''{0}''.
-XML_TYPE__TRANSIENT_PROP = The property ''{0}'' is transient and should not be included in the property order.
-XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM = The factory class element is ignored for enums.
-XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM = The factory method element is ignored for enums.
-XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM = The prop order element is ignored for enums.
-
-XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = The xml type of the element declaration with name ''{0}'' and namespace ''{1}'' conflicts with the xml type of the associated class
-
-XML_ENUM_VALUE__INVALID_LEXICAL_VALUE = Invalid lexical value \"{0}\" for schema type ''{1}''.
-
-ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION = The annotation ''{0}'' is not allowed to be used in conjunction with ''{1}''.
-ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED = The type for XML Java type adapter is not defined.
-XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION = An XML element wrapper may only be defined on a collection or array property
-
-XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlAnyAttribute. At most one field or property per class is allowed.
-XML_ANY_ATTRIBUTE__NON_MAP_TYPE = The type of a field or property annotated with @XmlAnyAttribute must be assignable to java.util.Map.
-
-XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlAnyElement. At most one field or property per class is allowed.
-
-XML_ATTRIBUTE__INVALID_SCHEMA_TYPE = The expected XML type associated with ''{0}'' is not valid for XML attribute ''{1}''.
-
-XML_ELEMENT__UNSPECIFIED_TYPE = Unspecified XML element type.
-XML_ELEMENT__ILLEGAL_TYPE = XML element type must be a sub-type of ''{0}''.
-XML_ELEMENT__INVALID_SCHEMA_TYPE = The expected XML type associated with ''{0}'' is not valid for XML element ''{1}''.
-
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = An element factory method must have a return type of ''javax.xml.bind.JAXBElement''.
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM = An element factory method must have a single parameter assignable to ''java.lang.Object''.
-XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME = XML element decl substitution head must not match its XML element.
-XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL = XML element decl substitution head must match another XML element decl.
-
-XML_ELEMENT_REF__UNSPECIFIED_TYPE = Unspecified XML element ref type.
-XML_ELEMENT_REF__ILLEGAL_TYPE = XML element ref type must be a sub-type of ''{0}''.
-XML_ELEMENT_REF__NO_ROOT_ELEMENT = No root element specified on type ''{0}'' or any of its sub-types.
-XML_ELEMENT_REF__NO_REGISTRY = No XML registry configured for this package.
-XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL = No XML element decl in the XML registry matching the namespace ''{0}'' and name ''{1}''.
-
-XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE = Duplicate type ''{0}'' in XML element refs.
-XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME = Duplicate element name ''{0}'' in XML element refs.
-
-XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE = Duplicate type ''{0}'' in XML elements.
-XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME = Duplicate element name ''{0}'' in XML elements.
-
-XML_ID__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are mapped as XmlID. At most one field or property per class is allowed.
-XML_ID__ATTRIBUTE_TYPE_NOT_STRING = An attribute mapped as XmlID must have type ''java.lang.String''.
-XML_ID__SCHEMA_TYPE_NOT_ID = In order to be mapped as XmlID, the type of the schema component ''{0}'' must be ''ID''.
-
-XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID = In order to be used with XmlIDREF, type ''{0}'' must contain a property or field mapped as an XmlID.
-XML_ID_REF__SCHEMA_TYPE_NOT_IDREF = In order to be used with XmlIDREF, the item type of the schema component ''{0}'' must be ''IDREF''.
-
-XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE = In order to be mapped as XmlList, an attribute must have a collection or array type.
-XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE = In order to be mapped as XmlList, the type ''{0}'' must be mapped to a non-list simple schema type.
-
-XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE = Multiple classes in package annotated with XmlRegistry.
-XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME = Duplicate XmlElementDecl name ''{0}'' {1}.
-
-XML_VALUE__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are mapped as XmlValue. At most one field or property per class is allowed.
-XML_VALUE__NO_TEXT_CONTENT = There is no text content for the XML type associated with this class.
-XML_VALUE__INVALID_SCHEMA_TYPE = The expected XML type associated with ''{0}'' is not valid for text content of the XML type associated with this class.
-
-XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = Attribute ''{0}'' must be mapped as XmlAttribute because another attribute ''{1}'' is mapped as XmlValue
-
-XML_SCHEMA_TYPE__NON_SIMPLE_TYPE = The schema type ''{0}'' is not a simple type.
-XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE = The ''type'' element should be specified when defining a schema type on a package.
-XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE = The ''type'' element should not be specified when defining a schema type on a field or property.
-
-QNAME__MISSING_NAME = {0} name not specified
-QNAME__UNRESOLVED_COMPONENT = Cannot resolve {0} with namespace ''{1}'' and name ''{2}'' in this context \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
deleted file mode 100644
index 067fcecf05..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 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
-################################################################################
-
-CONTEXT_MODEL_SYNC_JOB_NAME=Synchronize JAXB project: ''{0}''
-UPDATE_JOB_NAME=Update JAXB project: ''{0}''
-PREFERENCES_FLUSH_JOB_NAME=Flush Preferences: {0}
-
-ClassesGenerator_generatingClasses = Generating JAXB Classes from Schema
-ClassesGenerator_generatingClassesTask = Generating classes
-
-JaxbFacetConfig_validatePlatformNotSpecified = Platform must be specified
-JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion = Platform does not support the current JAXB facet version
-
-JreLibraryValidator_invalidPlatform = The JRE only provides implementation for a Generic JAXB platform.
-JreLibraryValidator_invalidJavaFacet = The specified Java version of {0} is insufficient to provide an implementation for JAXB version {1}. The JAXB implementation of a Java {0} runtime environment must be manually overridden by an endorsement mechanism of your choice.
-JreLibraryValidator_invalidJavaLibrary = The configured runtime is insufficient to provide an implementation for JAXB {0}.
-
-SchemaGenerator_creatingJAXBPropertiesFileTask = Creating jaxb.properties file
-
-UserLibraryValidator_incompatibleJavaFacet = The specified Java version of {0} provides a JAXB implementation that conflicts with JAXB version {1}. The JAXB implementation of a Java {0} runtime environment must be manually overridden by an endorsement mechanism of your choice.
-UserLibraryValidator_incompatibleJavaLibrary = The configured runtime conflicts with JAXB version {0}.
-
-XML_ATTRIBUTE_DESC = XML attribute declaration
-XML_ELEMENT_DESC = XML element declaration
-XML_TYPE_DESC = XML type definition
-SUBSTITUTION_HEAD_DESC = XML element substitution head
-
-XML_ELEMENT_DECL__SCOPE = in the scope of ''{0}''
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd b/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd
deleted file mode 100644
index 92b9195c13..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.jaxb.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.jaxb.core" id="jaxbPlatforms" name="JAXB Platforms"/>
- </appinfo>
- <documentation>
- This is used for defining JAXB platforms and JAXB platform versions.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="jaxbPlatformGroup"/>
- <element ref="jaxbPlatform"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatformGroup">
- <annotation>
- <documentation>
- Declares a JAXB platform group. Acts as a sort of &quot;super&quot; platform. Most useful for enabling functionality for a set of platforms without having to enable the functionality for each platform separately.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique identifier for a JAXB platform group.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A translatable string representation of the JAXB platform group.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatform">
- <annotation>
- <documentation>
- Declares a JAXB platform. One JAXB platform will be selected per JAXB-faceted project. See &lt;samp&gt;org.eclipse.jpt.jaxb.core.JaxbPlatform&lt;/samp&gt; for more information on JAXB platforms. Also see the org.eclipse.jpt.jaxb.ui.jaxbPlatformUis extension point.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A translatable string representation of the platform.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;samp&gt;org.eclipse.jpt.jaxb.core.JaxbPlatformDefinitionFactory&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.jaxb.core.JaxbPlatformDefinitionFactory"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="group" type="string">
- <annotation>
- <documentation>
- Declares which JAXB platform group this platform belongs to. If none is specified, this platform will be assumed to belong to its own group with the same id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jaxbFacetVersion" type="string">
- <annotation>
- <documentation>
- Declares the JAXB facet version for which this platform may be used. If no facet version is specified, this platform is available for all JAXB facet versions.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="default" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- Declares whether this platform should be used as a default JAXB platform for new JAXB project content. Note that if a workspace contains more than one default platform for a JAXB facet version, one of them will be chosen at random. By default, a platform is not a default platform.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- JPT 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;
-The following example is the included generic JAXB 2.2 platform and its platform group
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension point=&quot;org.eclipse.jpt.jaxb.core.jaxbPlatforms&quot;&gt;
-
- &lt;jaxbPlatformGroup
- id=&quot;generic&quot;
- label=&quot;%GENERIC_PLATFORM_GROUP_LABEL&quot;/&gt;
-
- &lt;jaxbPlatform
- id=&quot;generic_2_2&quot;
- label=&quot;%GENERIC_2_2_PLATFORM_LABEL&quot;
- factoryClass=&quot;org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinitionFactory&quot;
- group=&quot;generic&quot;
- jaxbFacetVersion=&quot;2.2&quot;
- default=&quot;false&quot;/&gt;
-
- &lt;/extension&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-Provisional API: This interface is part of an interim API that is still
-under development and expected to change significantly before reaching
-stability. It is available at this early stage to solicit feedback from
-pioneering adopters on the understanding that any code that uses this API
-will almost certainly be broken (repeatedly) as the API evolves.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;The org.eclipse.jpt.jaxb.core plug-in provides the following jaxb platforms:
-&lt;ul&gt;
-&lt;li&gt;generic_2_2&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
-&lt;p&gt;and the following jaxb platform groups:
-&lt;ul&gt;
-&lt;li&gt;generic&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2010 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java
deleted file mode 100644
index a6cda374d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-/**
- * Constants pertaining to the Generic JAXB platforms and their group.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class GenericJaxbPlatform {
-
- public static final JaxbPlatformGroupDescription GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("generic"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_1
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("generic_2_1"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_2
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("generic_2_2"); //$NON-NLS-1$
-
-
- /**
- * Not for instantiation
- */
- private GenericJaxbPlatform() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
deleted file mode 100644
index d8fbf291a5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
+++ /dev/null
@@ -1,1107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.CallbackJobSynchronizer;
-import org.eclipse.jpt.common.core.internal.utility.JobSynchronizer;
-import org.eclipse.jpt.common.core.utility.command.JobCommand;
-import org.eclipse.jpt.common.utility.ExceptionHandler;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.command.StatefulCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.common.utility.internal.command.AsynchronousExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.command.SimpleStatefulExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.SimpleJaxbProjectConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-import org.osgi.framework.BundleContext;
-
-/**
- * The JAXB project manager maintains a list of all JAXB projects in the workspace.
- * It keeps the list (and the state of the JAXB projects themselves)
- * synchronized with the workspace by listening for various
- * changes:<ul>
- * <li>Resource
- * <li>Java
- * <li>Faceted Project
- * </ul>
- * We use an Eclipse {@link ILock lock} to synchronize access to the JAXB
- * projects when dealing with these events. In an effort to reduce deadlocks,
- * the simple Resource and Java change events are dispatched to a background
- * thread, allowing us to handle the events outside of the workspace lock held
- * during resource and Java change notifications.
- * <p>
- * Events that trigger either the adding or removing of a JAXB project (e.g.
- * {@link IResourceChangeEvent#POST_CHANGE}) are handled "synchronously"
- * by allowing the background thread to handle any outstanding events before
- * updating the list of JAXB projects and returning execution to the event
- * source.
- * <p>
- * Various things that cause us to add or remove a JAXB project:<ul>
- * <li>The {@link JptJaxbCorePlugin} will "lazily" instantiate and {@link #start() start}
- * a JAXB project manager as appropriate. This will trigger the manager
- * to find and add all pre-existing JAXB projects.
- *
- * <li>Project created and facet installed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * <li>Project facet uninstalled<p>
- * {@link IFacetedProjectEvent.Type#PRE_UNINSTALL}
- *
- * <li>Project opened<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#ADDED} facet settings file
- * (<code>/.settings/org.eclipse.wst.common.project.facet.core.xml</code>)
- * <li>Project closed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file
- *
- * <li>Pre-existing project imported from directory or archive (created and opened)<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#ADDED} facet settings file
- * <li>Project renamed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file of old project
- * -> {@link IResourceDelta#ADDED} facet settings file of new project
- * <li>Project deleted<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file
- *
- * <li>Project facet installed by editing the facets settings file directly<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#CHANGED} facet settings file
- * <li>Project facet uninstalled by editing the facets settings file directly<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#CHANGED} facet settings file
- * </ul>
- */
-//TODO Still need to look at faceted project listener for facet uninstall
-class GenericJaxbProjectManager
- extends AbstractModel
- implements JaxbProjectManager {
-
- /**
- * All the JAXB projects in the workspace.
- */
- private final Vector<JaxbProject> jaxbProjects = new Vector<JaxbProject>();
-
- /**
- * Synchronize access to the JAXB projects.
- */
- /* private */ final ILock lock = this.getJobManager().newLock();
-
- /**
- * Determine how Resource and Java change events are
- * handled (i.e. synchronously or asynchronously).
- */
- private volatile StatefulCommandExecutor eventHandler =
- new AsynchronousExtendedCommandExecutor(
- JptCommonCoreMessages.DALI_EVENT_HANDLER_THREAD_NAME,
- new LocalExceptionHandler()
- );
-
- /* CU private */ class LocalExceptionHandler
- implements ExceptionHandler
- {
- public void handleException(Throwable t) {
- JptJaxbCorePlugin.log(t);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- /**
- * Listen for<ul>
- * <li>changes to projects and files
- * <li>clean builds
- * </ul>
- */
- private final IResourceChangeListener resourceChangeListener = new ResourceChangeListener();
-
- /**
- * The types of resource change events that interest
- * {@link #resourceChangeListener}.
- */
- private static final int RESOURCE_CHANGE_EVENT_TYPES =
- IResourceChangeEvent.POST_CHANGE |
- IResourceChangeEvent.POST_BUILD;
-
- /**
- * Listen for changes to this file to determine when the JAXB facet is
- * added to or removed from a "faceted" project.
- */
- private static final String FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME = FacetedProjectFramework.PLUGIN_ID + ".xml"; //$NON-NLS-1$
-
- /**
- * Listen for the JAXB facet being added to or removed from a "faceted" project.
- */
- private final IFacetedProjectListener facetedProjectListener = new FacetedProjectListener();
-
- /**
- * The types of faceted project events that interest
- * {@link #facetedProjectListener}.
- */
- private static final IFacetedProjectEvent.Type[] FACETED_PROJECT_EVENT_TYPES = new IFacetedProjectEvent.Type[] {
- IFacetedProjectEvent.Type.PRE_UNINSTALL
- };
-
- /**
- * Listen for Java changes (unless the Dali UI is active).
- * @see #javaElementChangeListenerIsActive()
- */
- private final JavaElementChangeListener javaElementChangeListener = new JavaElementChangeListener();
-
- /**
- * The types of resource change events that interest
- * {@link #javaElementChangeListener}.
- */
- private static final int JAVA_CHANGE_EVENT_TYPES =
- ElementChangedEvent.POST_CHANGE |
- ElementChangedEvent.POST_RECONCILE;
-
-
- // ********** constructor **********
-
- /**
- * Internal: called by {@link JptJUaxbCorePlugin Dali plug-in}.
- */
- GenericJaxbProjectManager() {
- super();
- }
-
-
- // ********** plug-in controlled life-cycle **********
-
- /**
- * Internal: called by {@link JptJaxbCorePlugin Dali plug-in}.
- */
- void start() {
- try {
- this.lock.acquire();
- this.start_();
- } finally {
- this.lock.release();
- }
- }
-
- private void start_() {
- debug("*** JAXB project manager START ***"); //$NON-NLS-1$
- try {
- this.buildJaxbProjects();
- this.eventHandler.start();
- this.getWorkspace().addResourceChangeListener(this.resourceChangeListener, RESOURCE_CHANGE_EVENT_TYPES);
- FacetedProjectFramework.addListener(this.facetedProjectListener, FACETED_PROJECT_EVENT_TYPES);
- JavaCore.addElementChangedListener(this.javaElementChangeListener, JAVA_CHANGE_EVENT_TYPES);
- } catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- this.stop_();
- }
- }
-
- /**
- * Side-effect: {@link #jaxbProjects} populated.
- */
- private void buildJaxbProjects() {
- try {
- this.buildJaxbProjects_();
- } catch (CoreException ex) {
- // if we have a problem, leave the currently built JAXB projects in
- // place and keep executing (should be OK...)
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- private void buildJaxbProjects_() throws CoreException {
- this.getWorkspace().getRoot().accept(new ResourceProxyVisitor(), IResource.NONE);
- }
-
- /**
- * Internal: called by {@link JptJaxbCorePlugin Dali plug-in}.
- */
- void stop() throws Exception {
- try {
- this.lock.acquire();
- this.stop_();
- } finally {
- this.lock.release();
- }
- }
-
- private void stop_() {
- debug("*** JAXB project manager STOP ***"); //$NON-NLS-1$
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- FacetedProjectFramework.removeListener(this.facetedProjectListener);
- this.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- try {
- this.eventHandler.stop();
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- }
- this.clearJaxbProjects();
- }
-
- private void clearJaxbProjects() {
- // clone to prevent concurrent modification exceptions
- for (JaxbProject jaxbProject : this.getJaxbProjects_()) {
- this.removeJaxbProject(jaxbProject);
- }
- }
-
-
- // ********** JaxbProjectManager implementation **********
-
- public Iterable<JaxbProject> getJaxbProjects() {
- try {
- this.lock.acquire();
- return this.getJaxbProjects_();
- } finally {
- this.lock.release();
- }
- }
-
- private Iterable<JaxbProject> getJaxbProjects_() {
- return new LiveCloneIterable<JaxbProject>(this.jaxbProjects);
- }
-
- public int getJaxbProjectsSize() {
- return this.jaxbProjects.size();
- }
-
- public JaxbProject getJaxbProject(IProject project) {
- try {
- this.lock.acquire();
- return this.getJaxbProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- private JaxbProject getJaxbProject_(IProject project) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- if (jaxbProject.getProject().equals(project)) {
- return jaxbProject;
- }
- }
- return null;
- }
-
- public JaxbFile getJaxbFile(IFile file) {
- JaxbProject jaxbProject = this.getJaxbProject(file.getProject());
- return (jaxbProject == null) ? null : jaxbProject.getJaxbFile(file);
- }
-
- public void rebuildJaxbProject(IProject project) {
- try {
- this.lock.acquire();
- this.rebuildJaxbProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- /**
- * assumption: the JAXB project holder exists
- */
- private void rebuildJaxbProject_(IProject project) {
- this.removeJaxbProject(this.getJaxbProject_(project));
- this.addJaxbProject(project);
- }
-
- public boolean javaElementChangeListenerIsActive() {
- return this.javaElementChangeListener.isActive();
- }
-
- public void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive) {
- this.javaElementChangeListener.setActive(javaElementChangeListenerIsActive);
- }
-
- public IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public IJobManager getJobManager() {
- return Job.getJobManager();
- }
-
-
- // ********** adding/removing JAXB projects **********
-
- /* private */ void addJaxbProject(IProject project) {
- this.addJaxbProject(this.buildJaxbProject(project));
- }
-
- private void addJaxbProject(JaxbProject jaxbProject) {
- // figure out exactly when JAXB projects are added
- dumpStackTrace("add: ", jaxbProject); //$NON-NLS-1$
- // the JAXB project will be null if we have any problems building it...
- // (e.g. if we have problems getting the JAXB platform)
- if (jaxbProject != null) {
- this.addItemToCollection(jaxbProject, this.jaxbProjects, JAXB_PROJECTS_COLLECTION);
- }
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(IProject project) {
- return this.buildJaxbProject(this.buildJaxbProjectConfig(project));
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(JaxbProject.Config config) {
- JaxbPlatformDefinition platformDefinition = config.getPlatformDefinition();
- if (platformDefinition == null) {
- return null;
- }
- JaxbProject jaxbProject = this.buildJaxbProject(platformDefinition, config);
- if (jaxbProject == null) {
- return null;
- }
- jaxbProject.setContextModelSynchronizer(buildJobContextModelSynchronizer(jaxbProject));
- jaxbProject.setUpdateSynchronizer(buildJobUpdateSynchronizer(jaxbProject));
- return jaxbProject;
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(JaxbPlatformDefinition platformDefinition, JaxbProject.Config config) {
- try {
- return platformDefinition.getFactory().buildJaxbProject(config);
- }
- catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- return null;
- }
- }
-
- private JaxbProject.Config buildJaxbProjectConfig(IProject project) {
- SimpleJaxbProjectConfig config = new SimpleJaxbProjectConfig();
- config.setProject(project);
- config.setPlatformDefinition(JptJaxbCorePlugin.getJaxbPlatformManager().buildJaxbPlatformDefinition(project));
- return config;
- }
-
- private Synchronizer buildJobContextModelSynchronizer(JaxbProject jaxbProject) {
- return new JobSynchronizer(
- buildContextModelJobName(jaxbProject),
- buildContextModelJobCommand(jaxbProject),
- jaxbProject.getProject());
- }
-
- private String buildContextModelJobName(JaxbProject jaxbProject) {
- return NLS.bind(JptJaxbCoreMessages.CONTEXT_MODEL_SYNC_JOB_NAME, jaxbProject.getName());
- }
-
- private JobCommand buildContextModelJobCommand(final JaxbProject jaxbProject) {
- return new JobCommand() {
- public IStatus execute(IProgressMonitor monitor) {
- return jaxbProject.synchronizeContextModel(monitor);
- }
- };
- }
-
- private CallbackSynchronizer buildJobUpdateSynchronizer(JaxbProject jaxbProject) {
- return new CallbackJobSynchronizer(
- buildUpdateJobName(jaxbProject),
- buildUpdateJobCommand(jaxbProject),
- jaxbProject.getProject());
- }
-
- private String buildUpdateJobName(JaxbProject jaxbProject) {
- return NLS.bind(JptJaxbCoreMessages.UPDATE_JOB_NAME, jaxbProject.getName());
- }
-
- private JobCommand buildUpdateJobCommand(final JaxbProject jaxbProject) {
- return new JobCommand() {
- public IStatus execute(IProgressMonitor monitor) {
- return jaxbProject.update(monitor);
- }
- };
- }
-
- /* private */ void removeJaxbProject(JaxbProject jaxbProject) {
- // figure out exactly when JAXB projects are removed
- dumpStackTrace("remove: ", jaxbProject); //$NON-NLS-1$
- this.removeItemFromCollection(jaxbProject, this.jaxbProjects, JAXB_PROJECTS_COLLECTION);
- jaxbProject.dispose();
- }
-
-
- // ********** Project POST_CHANGE **********
-
- /* private */ void projectChanged(IResourceDelta delta) {
- this.eventHandler.execute(this.buildProjectChangedCommand(delta));
- }
-
- private Command buildProjectChangedCommand(final IResourceDelta delta) {
- return new EventHandlerCommand("Project POST_CHANGE Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.projectChanged_(delta);
- }
- };
- }
-
- /**
- * Forward the specified resource delta to all our JAXB projects;
- * they will each determine whether the event is significant.
- */
- /* private */ void projectChanged_(IResourceDelta delta) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- jaxbProject.projectChanged(delta);
- }
- }
-
-
- // ********** Project POST_BUILD (CLEAN_BUILD) **********
-
- /* private */ void projectPostCleanBuild(IProject project) {
- this.executeAfterEventsHandled(this.buildProjectPostCleanBuildCommand(project));
- }
-
- private Command buildProjectPostCleanBuildCommand(final IProject project) {
- return new EventHandlerCommand("Project POST_BUILD (CLEAN_BUILD) Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.projectPostCleanBuild_(project);
- }
- };
- }
-
- /* private */ void projectPostCleanBuild_(IProject project) {
- JaxbProject jaxbProject = this.getJaxbProject_(project);
- if (jaxbProject != null) {
- this.removeJaxbProject(jaxbProject);
- this.addJaxbProject(project);
- }
- }
-
-
- // ********** File POST_CHANGE **********
-
- /**
- * The Faceted Project settings file has changed in some fashion, check
- * whether the JAXB facet has been added to or removed from the specified
- * project.
- */
- /* private */ void checkForJaxbFacetTransition(IProject project) {
- JaxbProject jaxbProject = this.getJaxbProject_(project);
-
- if (JaxbFacet.isInstalled(project)) {
- if (jaxbProject == null) { // JAXB facet added
- this.executeAfterEventsHandled(this.buildAddJaxbProjectCommand(project));
- }
- } else {
- if (jaxbProject != null) { // JAXB facet removed
- this.executeAfterEventsHandled(this.buildRemoveJaxbProjectCommand(jaxbProject));
- }
- }
- }
-
- private Command buildAddJaxbProjectCommand(final IProject project) {
- return new EventHandlerCommand("Add JAXB Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.addJaxbProject(project);
- }
- };
- }
-
- private Command buildRemoveJaxbProjectCommand(final JaxbProject jaxbProject) {
- return new EventHandlerCommand("Remove JAXB Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.removeJaxbProject(jaxbProject);
- }
- };
- }
-
- // ********** FacetedProject PRE_UNINSTALL **********
-
- /* private */ void jaxbFacetedProjectPreUninstall(IProjectFacetActionEvent event) {
- IProject project = event.getProject().getProject();
- this.executeAfterEventsHandled(this.buildJaxbFacetedProjectPreUninstallCommand(project));
- }
-
- private Command buildJaxbFacetedProjectPreUninstallCommand(final IProject project) {
- return new EventHandlerCommand("Faceted Project PRE_UNINSTALL Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.jaxbFacetedProjectPreUninstall_(project);
- }
- };
- }
-
- /* private */ void jaxbFacetedProjectPreUninstall_(IProject project) {
- // assume(?) this is the first event to indicate we need to remove the JAXB project from the JAXB project manager
- this.removeJaxbProject(this.getJaxbProject_(project));
- }
-
-
- // ********** Java element changed **********
-
- /* private */ void javaElementChanged(ElementChangedEvent event) {
- this.eventHandler.execute(this.buildJavaElementChangedCommand(event));
- }
-
- private Command buildJavaElementChangedCommand(final ElementChangedEvent event) {
- return new EventHandlerCommand("Java element changed Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.javaElementChanged_(event);
- }
- };
- }
-
- /**
- * Forward the Java element changed event to all the JAXB projects
- * because the event could affect multiple projects.
- */
- /* private */ void javaElementChanged_(ElementChangedEvent event) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- jaxbProject.javaElementChanged(event);
- }
- }
-
-
- // ********** miscellaneous **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.jaxbProjects);
- }
-
-
- // ********** event handler **********
-
- /**
- * If the event handler is executing asynchronously:<br>
- * Allow all the commands currently on the command executor's queue to execute.
- * Once they have executed, suspend the command executor and process the
- * specified command (on <em>this</em> thread, <em>not</em> the command
- * executor thread). Once the specified command is finished, allow the
- * command executor to resume processing its command queue.
- * <p>
- * If the event handler is executing synchronously:<br>
- * All the events have already been handled synchronously, so we simply
- * execute the specified command [sorta] directly.
- */
- private void executeAfterEventsHandled(Command command) {
- SynchronizedBoolean flag = new SynchronizedBoolean(false);
- this.eventHandler.execute(new PauseCommand(flag));
- try {
- flag.waitUntilTrue();
- } catch (InterruptedException ex) {
- // ignore - not sure why this thread would be interrupted
- }
- try {
- command.execute();
- } finally {
- flag.setFalse();
- }
- }
-
- /**
- * If this "pause" command is executing (asynchronously) on a different
- * thread than the JAXB project manager:<ol>
- * <li>it will set the flag to <code>true</code>, allowing the JAXB project
- * manager to resume executing on its own thread
- * <li>then it will suspend its command executor until the JAXB project
- * manager sets the flag back to <code>false</code>.
- * </ol>
- * If this "pause" command is executing (synchronously) on the same thread
- * as the JAXB project manager, it will simply set the flag to
- * <code>true</code> and return.
- */
- private static class PauseCommand
- implements Command
- {
- private final Thread producerThread;
- private final SynchronizedBoolean flag;
-
- PauseCommand(SynchronizedBoolean flag) {
- this(Thread.currentThread(), flag);
- }
-
- PauseCommand(Thread producerThread, SynchronizedBoolean flag) {
- super();
- this.producerThread = producerThread;
- this.flag = flag;
- }
-
- public void execute() {
- this.flag.setTrue();
- if (Thread.currentThread() != this.producerThread) {
- try {
- this.flag.waitUntilFalse();
- } catch (InterruptedException ex) {
- // ignore - the command executor will check for interruptions
- }
- }
- }
- }
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * @see JptJaxbCoreTestsPlugin#start(BundleContext)
- */
- public void handleEventsSynchronously() throws InterruptedException {
- try {
- this.lock.acquire();
- this.handleEventsSynchronously_();
- } finally {
- this.lock.release();
- }
- }
-
- private void handleEventsSynchronously_() throws InterruptedException {
- this.eventHandler.stop();
- this.eventHandler = new SimpleStatefulExtendedCommandExecutor();
- this.eventHandler.start();
- }
-
-
- // ********** resource proxy visitor **********
-
- /**
- * Visit the workspace resource tree, adding a JAXB project to the
- * JAXB project manager for each open Eclipse project that has a JAXB facet.
- */
- private class ResourceProxyVisitor implements IResourceProxyVisitor {
- ResourceProxyVisitor() {
- super();
- }
-
- public boolean visit(IResourceProxy resourceProxy) {
- switch (resourceProxy.getType()) {
- case IResource.ROOT :
- return true; // all projects are in the "root"
- case IResource.PROJECT :
- this.processProject(resourceProxy);
- return false; // no nested projects
- case IResource.FOLDER :
- return false; // ignore
- case IResource.FILE :
- return false; // ignore
- default :
- return false;
- }
- }
-
- private void processProject(IResourceProxy resourceProxy) {
- if (resourceProxy.isAccessible()) { // the project exists and is open
- IProject project = (IProject) resourceProxy.requestResource();
- if (JaxbFacet.isInstalled(project)) {
- GenericJaxbProjectManager.this.addJaxbProject(project);
- }
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** event handler command **********
-
- /**
- * Command that holds the JAXB project manager lock while
- * executing.
- */
- private abstract class EventHandlerCommand
- implements Command
- {
- private final String name;
-
- EventHandlerCommand(String name) {
- super();
- this.name = name;
- }
-
- public final void execute() {
- try {
- GenericJaxbProjectManager.this.lock.acquire();
- this.execute_();
- } catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- } finally {
- GenericJaxbProjectManager.this.lock.release();
- }
- }
-
- abstract void execute_();
-
- @Override
- public String toString() {
- return this.name;
- }
- }
-
-
- // ********** resource change listener **********
-
- private class ResourceChangeListener implements IResourceChangeListener {
-
- ResourceChangeListener() {
- super();
- }
-
- /**
- * PRE_UNINSTALL is the only facet event we use for
- * removing JAXB projects. These are the cases where we listen for resource events.
- * <p>
- * Check for:<ul>
- * <li>facet settings file added/removed/changed
- * (<code>/.settings/org.eclipse.wst.common.project.facet.core.xml</code>)
- * <li>file add/remove - forwarded to the individual JAXB projects
- * <li>project clean
- * </ul>
- */
- public void resourceChanged(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.POST_CHANGE :
- this.processPostChangeEvent(event);
- break;
-
- // workspace or project events
- case IResourceChangeEvent.PRE_REFRESH :
- break; // ignore
- case IResourceChangeEvent.PRE_BUILD :
- break; // ignore
- case IResourceChangeEvent.POST_BUILD :
- this.processPostBuildEvent(event);
- break;
-
- // project-only events
- case IResourceChangeEvent.PRE_CLOSE :
- break; // ignore
- case IResourceChangeEvent.PRE_DELETE :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostChangeEvent(IResourceChangeEvent event) {
- debug("Resource POST_CHANGE"); //$NON-NLS-1$
- this.processPostChangeDelta(event.getDelta());
- }
-
- private void processPostChangeDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.processPostChangeRootDelta(delta);
- break;
- case IResource.PROJECT :
- this.processPostChangeProjectDelta(delta);
- break;
- case IResource.FOLDER :
- this.processPostChangeFolderDelta((IFolder) resource, delta);
- break;
- case IResource.FILE :
- this.processPostChangeFileDelta((IFile) resource, delta);
- break;
- default :
- break;
- }
- }
-
- // ***** POST_CHANGE ROOT
- private void processPostChangeRootDelta(IResourceDelta delta) {
- this.processPostChangeDeltaChildren(delta);
- }
-
- // ***** POST_CHANGE PROJECT
- /**
- * Process the project first for the Opening project case.
- * The JAXB project will not be built until the children are processed
- * and we see that the facet metadata file is added.
- * Otherwise the JAXB project would be built and then we would process
- * the ADDED deltas for all the files in the project.
- */
- private void processPostChangeProjectDelta(IResourceDelta delta) {
- GenericJaxbProjectManager.this.projectChanged(delta);
- this.processPostChangeDeltaChildren(delta);
- }
-
- // ***** POST_CHANGE FOLDER
- private void processPostChangeFolderDelta(IFolder folder, IResourceDelta delta) {
- if (folder.getName().equals(".settings")) { //$NON-NLS-1$
- this.processPostChangeDeltaChildren(delta);
- }
- }
-
- // ***** POST_CHANGE FILE
- private void processPostChangeFileDelta(IFile file, IResourceDelta delta) {
- if (file.getName().equals(FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME)) {
- this.checkForFacetFileChanges(file, delta);
- }
- }
-
- private void checkForFacetFileChanges(IFile file, IResourceDelta delta) {
- switch (delta.getKind()) {
- case IResourceDelta.ADDED :
- case IResourceDelta.REMOVED :
- case IResourceDelta.CHANGED :
- GenericJaxbProjectManager.this.checkForJaxbFacetTransition(file.getProject());
- break;
- case IResourceDelta.ADDED_PHANTOM :
- break; // ignore
- case IResourceDelta.REMOVED_PHANTOM :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostChangeDeltaChildren(IResourceDelta delta) {
- for (IResourceDelta child : delta.getAffectedChildren()) {
- this.processPostChangeDelta(child); // recurse
- }
- }
-
- /**
- * A post build event has occurred.
- * Check for whether the build was a "clean" build and trigger project update.
- */
- // ***** POST_BUILD
- private void processPostBuildEvent(IResourceChangeEvent event) {
- debug("Resource POST_BUILD: ", event.getResource()); //$NON-NLS-1$
- if (event.getBuildKind() == IncrementalProjectBuilder.CLEAN_BUILD) {
- this.processPostCleanBuildDelta(event.getDelta());
- }
- }
-
- private void processPostCleanBuildDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.processPostCleanBuildDeltaChildren(delta);
- break;
- case IResource.PROJECT :
- this.processProjectPostCleanBuild((IProject) resource);
- break;
- case IResource.FOLDER :
- break; // ignore
- case IResource.FILE :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostCleanBuildDeltaChildren(IResourceDelta delta) {
- for (IResourceDelta child : delta.getAffectedChildren()) {
- this.processPostCleanBuildDelta(child); // recurse
- }
- }
-
- private void processProjectPostCleanBuild(IProject project) {
- debug("\tProject CLEAN: ", project.getName()); //$NON-NLS-1$
- GenericJaxbProjectManager.this.projectPostCleanBuild(project);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** faceted project listener **********
-
- /**
- * Forward the Faceted project change event back to the JAXB project manager.
- */
- private class FacetedProjectListener implements IFacetedProjectListener {
-
- FacetedProjectListener() {
- super();
- }
-
- /**
- * Check for:<ul>
- * <li>un-install of JAXB facet
- * </ul>
- */
- public void handleEvent(IFacetedProjectEvent event) {
- switch (event.getType()) {
- case PRE_UNINSTALL :
- this.processPreUninstallEvent((IProjectFacetActionEvent) event);
- break;
- default :
- break;
- }
- }
-
- private void processPreUninstallEvent(IProjectFacetActionEvent event) {
- debug("Facet PRE_UNINSTALL: ", event.getProjectFacet()); //$NON-NLS-1$
- if (event.getProjectFacet().equals(JaxbFacet.FACET)) {
- GenericJaxbProjectManager.this.jaxbFacetedProjectPreUninstall(event);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** Java element change listener **********
-
- /**
- * Forward the Java element change event back to the JAXB project manager.
- */
- private class JavaElementChangeListener implements IElementChangedListener {
- /**
- * A flag to activate/deactivate the listener
- * so we can ignore Java events whenever Dali is manipulating the Java
- * source code via the Dali model. We do this because the 0.5 sec delay
- * between the Java source being changed and the corresponding event
- * being fired causes us no end of pain.
- */
- private volatile boolean active = true;
-
- JavaElementChangeListener() {
- super();
- }
-
- public void elementChanged(ElementChangedEvent event) {
- if (this.active) {
- GenericJaxbProjectManager.this.javaElementChanged(event);
- }
- }
-
- void setActive(boolean active) {
- this.active = active;
- }
-
- boolean isActive() {
- return this.active;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** DEBUG **********
-
- // @see JaxbProjectManagerTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- /**
- * trigger #toString() call and string concatenation only if DEBUG is true
- */
- /* private */ static void debug(String message, Object object) {
- if (DEBUG) {
- debug_(message + object);
- }
- }
-
- /* private */ static void debug(String message) {
- if (DEBUG) {
- debug_(message);
- }
- }
-
- private static void debug_(String message) {
- System.out.println(Thread.currentThread().getName() + ": " + message); //$NON-NLS-1$
- }
-
- /* private */ static void dumpStackTrace() {
- dumpStackTrace(null);
- }
-
- /* private */ static void dumpStackTrace(String message, Object object) {
- if (DEBUG) {
- dumpStackTrace_(message + object);
- }
- }
-
- /* private */ static void dumpStackTrace(String message) {
- if (DEBUG) {
- dumpStackTrace_(message);
- }
- }
-
- private static void dumpStackTrace_(String message) {
- // lock System.out so the stack elements are printed out contiguously
- synchronized (System.out) {
- if (message != null) {
- debug_(message);
- }
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- // skip the first 3 elements - those are this method and 2 methods in Thread
- for (int i = 3; i < stackTrace.length; i++) {
- StackTraceElement element = stackTrace[i];
- if (element.getMethodName().equals("invoke0")) { //$NON-NLS-1$
- break; // skip all elements outside of the JUnit test
- }
- System.out.println("\t" + element); //$NON-NLS-1$
- }
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
deleted file mode 100644
index 1f647ca770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class JaxbFacet {
-
- public static final String ID = "jpt.jaxb"; //$NON-NLS-1$
-
- public static final IProjectFacet FACET = ProjectFacetsManager.getProjectFacet(ID);
-
- public static final IProjectFacetVersion VERSION_2_1 = FACET.getVersion("2.1"); //$NON-NLS-1$
-
- public static final IProjectFacetVersion VERSION_2_2 = FACET.getVersion("2.2"); //$NON-NLS-1$
-
-
- public static boolean isInstalled(final IProject project) {
- try {
- return FacetedProjectFramework.hasProjectFacet(project, ID);
- }
- catch (CoreException e) {
- JptJaxbCorePlugin.log(e);
- return false;
- }
- }
-
-
- /**
- * Not for instantiation
- */
- private JaxbFacet() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
deleted file mode 100644
index c97623657c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * Use a JAXB factory to build any core (e.g. {@link JaxbProject})
- * model object or any Java (e.g. {@link XmlType}) context model objects
- * <p>
- * Assumes a base JAXB project context structure
- * corresponding to the JAXB spec:
- * <pre>
- * RootContext
- * |- jaxb packages/types
- * |- jaxb attributes/methods
- * </pre>
- * ... and associated objects.
- *<p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @see org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbFactory {
-
- // ********** Core Model **********
-
- /**
- * Construct a JaxbProject for the specified config, to be
- * added to the specified JAXB project. Return null if unable to create
- * the JAXB file (e.g. the content type is unrecognized).
- */
- JaxbProject buildJaxbProject(JaxbProject.Config config);
-
- /**
- * Construct a JAXB file for the specified JAXB project, file, content type,
- * and resource model.
- */
- JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel);
-
-
- // ********** Non-resource-specific context nodes **********
-
- /**
- * Build a (/an updated) root context node to be associated with the given
- * JAXB project.
- * The root context node will be built once, but updated many times.
- * @see JaxbProject#update(org.eclipse.core.runtime.IProgressMonitor)
- */
- JaxbContextRoot buildContextRoot(JaxbProject jaxbProject);
-
- JaxbPackage buildPackage(JaxbContextRoot parent, String packageName);
-
-
- // ********** Java context nodes **********
-
- JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage);
-
- XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent);
-
- XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation);
-
- JaxbClass buildJaxbClass(JaxbContextRoot parent, JavaResourceType resourceType);
-
- JaxbEnum buildJaxbEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum);
-
- JaxbClassMapping buildJaxbClassMapping(JaxbClass parent);
-
- JaxbEnumMapping buildJaxbEnumMapping(JaxbEnum parent);
-
- XmlRegistry buildXmlRegistry(JaxbClass parent);
-
- JaxbElementFactoryMethod buildJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod);
-
- XmlRootElement buildJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation xmlRootElementAnnotation);
-
- JaxbPersistentAttribute buildJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor);
-
- JaxbPersistentAttribute buildJavaPersistentField(JaxbClassMapping parent, JavaResourceField resourceField);
-
- JaxbPersistentAttribute buildJavaPersistentProperty(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- JaxbAttributeMapping buildJavaNullAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent);
-
- XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent);
-
- XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent);
-
- XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent);
-
- XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent);
-
- JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent);
-
- XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent);
-
- JaxbEnumConstant buildJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java
deleted file mode 100644
index a3e133a33d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-/**
- * A JAXB Project contains JAXB files for all files in the project that
- * are relevant to the JAXB spec.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbFile
- extends JaxbNode
-{
- /**
- * Return the JAXB file's Eclipse file.
- */
- IFile getFile();
-
- /**JAXB
- * Return the JPA file's content type.
- */
- IContentType getContentType();
-
- /**
- * Return the resource model corresponding to the JPA file; typically a JPA
- * compilation unit, a JPA XML resource, or a JPA package fragment root (JAR).
- */
- JptResourceModel getResourceModel();
-
- /**
- * Convenience method. Return the resource model corresponding to the JPA
- * file if the file's content is a "kind-of" the specified content type;
- * otherwise, return null. This is useful when a client has looked up the
- * JPA file via a file name [and assumed content type].
- * @see #getResourceModel()
- */
- JptResourceModel getResourceModel(IContentType contentType);
-
-
- // ********** root structure nodes **********
-
-// /**
-// * Return the JPA file's root structure nodes.
-// */
-// Iterator<JpaStructureNode> rootStructureNodes();
-// String ROOT_STRUCTURE_NODES_COLLECTION = "rootStructureNodes"; //$NON-NLS-1$
-//
-// /**
-// * Return the count of the JPA file's root context model objects.
-// */
-// int rootStructureNodesSize();
-//
-// /**
-// * Add a root structure node.
-// * There is the potential for multiple root structure nodes
-// * for a particular key. For example, a Java file that is listed
-// * both as a <class> in the persistence.xml and as an <entity> in
-// * an orm.xml file. In this case the orm.xml file needs to set
-// * the root structure node after the Java class reference.
-// * Last one in during project "update" wins.
-// */
-// void addRootStructureNode(Object key, JpaStructureNode rootStructureNode);
-//
-// /**
-// * @see #addRootStructureNode(Object, JpaStructureNode)
-// */
-// void removeRootStructureNode(Object key);
-//
-// /**
-// * Return the structure node best corresponding to the location in the file.
-// */
-// JpaStructureNode getStructureNode(int textOffset);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java
deleted file mode 100644
index 3558c3f254..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.utility.model.Model;
-
-/**
- * JAXB-specific protocol. All JAXB objects belong to a JAXB project, are
- * associated with a resource, and have a parent (excepting the JAXB project).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbNode
- extends Model, IAdaptable
-{
- /**
- * Return the JAXB project the node belongs to.
- */
- JaxbProject getJaxbProject();
-
- /**
- * Return the JAXB node's parent. The JAXB project will not have a parent.
- */
- JaxbNode getParent();
-
- void stateChanged();
-
- /**
- * Return the node's resource, typically for validation messages.
- */
- IResource getResource();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
deleted file mode 100644
index df8afc4081..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.command.ExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * A JAXB project is associated with an Eclipse project (and its corresponding
- * Java project). It holds the "resource" model that corresponds to the various
- * JPA-related resources (the <code>persistence.xml</code> file, its mapping files
- * [<code>orm.xml</code>],
- * and the Java source files). It also holds the "context" model that represents
- * the JPA metadata, as derived from spec-defined defaults, Java source code
- * annotations, and XML descriptors.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbProject
- extends JaxbNode
-{
-
- // ********** general **********
-
- /**
- * Return the JAXB project's name, which is the same as the associated
- * Eclipse project's name.
- */
- String getName();
-
- /**
- * Return the Eclipse project associated with the JAXB project.
- */
- IProject getProject();
-
- /**
- * Return the Java project associated with the JAXB project.
- */
- IJavaProject getJavaProject();
-
- /**
- * Return the vendor-specific JAXB platform that builds the JAXB project
- * and its contents.
- */
- JaxbPlatform getPlatform();
-
- /**
- * Return the schema library used for validating and user assist
- */
- SchemaLibrary getSchemaLibrary();
-
- /**
- * The JAXB project has been removed from the JJAXBPA model. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
-
- // ********** JAXB files **********
-
- /**
- * ID string used when the JAXB project's collection of JAXB files changes.
- * @see #addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener)
- */
- String JAXB_FILES_COLLECTION = "jaxbFiles"; //$NON-NLS-1$
-
- /**
- * Return the JAXB project's JAXB files.
- */
- Iterable<JaxbFile> getJaxbFiles();
-
- /**
- * Return the size of the JAXB project's JAXB files.
- */
- int getJaxbFilesSize();
-
- /**
- * Return the JAXB file corresponding to the specified file.
- * Return null if there is no JAXB file associated with the specified file.
- */
- JaxbFile getJaxbFile(IFile file);
-
-
-// // ********** external Java resource compilation units **********
-//
-// /**
-// * ID string used when the JPA project's collection of external Java
-// * resource compilation units changes.
-// * @see #addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener)
-// */
-// String EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION = "externalJavaResourceCompilationUnits"; //$NON-NLS-1$
-//
-// /**
-// * Return the JPA project's external Java resource compilation units.
-// */
-// Iterator<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits();
-//
-// /**
-// * Return the size of the JPA project's external Java resource compilation units.
-// */
-// int externalJavaResourceCompilationUnitsSize();
-//
-//
-// // ********** external Java resource persistent types **********
-//
-// /**
-// * Return the JPA project's external Java resource persistent type cache.
-// */
-// JavaResourcePersistentTypeCache getExternalJavaResourcePersistentTypeCache();
-//
-
- // ********** Java resources **********
-
- /**
- * Return the Java resource packages for the project.
- * Return null if invalid or absent. These correspond to package-info.java files
- */
- Iterable<JavaResourcePackage> getJavaResourcePackages();
-
- /**
- * Return the Java resource package for the specified package.
- * Return null if invalid or absent.
- */
- JavaResourcePackage getJavaResourcePackage(String packageName);
-
- /**
- * Return the java resource packages that are annotated with
- * 1 or more valid JAXB package annotations
- */
- Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages();
-
- /**
- * Return the java resource package for the specified package if and only if it has
- * recognized annotations.
- * Return null otherwise.
- */
- JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName);
-
-// /**
-// * Return the Java resource package fragement root for the specified JAR.
-// * Return null if absent.
-// */
-// JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName);
-
- /**
- * Return all {@link JavaResourceAbstractType}s that are represented by java source within this project
- */
- Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes();
-
- /**
- * Return all {@link JavaResourceAbstractType}s that are represented by java source within this project,
- * that are also annotated with a recognized annotation (and are persistable)
- */
- Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes();
-
-// /**
-// * Return the names of the JAXB project's annotated Java classes
-// */
-// Iterable<String> getAnnotatedJavaSourceClassNames();
-
- /**
- * Return the {@link JavaResourceAbstractType} with the specified type name, regardless of
- * what kind it is.
- * Return null if absent.
- */
- JavaResourceAbstractType getJavaResourceType(String typeName);
-
- /**
- * Return the {@link JavaResourceAbstractType} with the specified type name and kind.
- * Return null if invalid or absent or if the kind does not match.
- */
- JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAbstractType.Kind kind);
-
-
- // **************** jaxb.index resources **********************************
-
- /**
- * Return all jaxb.index resource models within the project
- */
- Iterable<JaxbIndexResource> getJaxbIndexResources();
-
- /**
- * Return the first jaxb.index resource model (could be multiple if there are multiple locations
- * for a given package) with the given package name
- */
- JaxbIndexResource getJaxbIndexResource(String packageName);
-
-
- // **************** jaxb.properties resources *****************************
-
- /**
- * Return all jaxb.properties resource models within the project
- */
- Iterable<JaxbPropertiesResource> getJaxbPropertiesResources();
-
- /**
- * Return the first jaxb.properties resource model (could be multiple if there are multiple locations
- * for a given package) with the given package name
- */
- JaxbPropertiesResource getJaxbPropertiesResource(String packageName);
-
-
- // **************** context model *****************************************
-
- /**
- * Return the root of the JAXB project's context model.
- */
- JaxbContextRoot getContextRoot();
-
- /**
- * Return all types/package infos that are primary context objects for the
- * given compilation unit
- */
- Iterable<? extends JavaContextNode> getPrimaryJavaNodes(ICompilationUnit cu);
-
-
- // ********** model synchronization **********
-
- /**
- * Synchronize the JPA project with the specified project resource
- * delta, watching for added and removed files in particular.
- */
- void projectChanged(IResourceDelta delta);
-
- /**
- * Synchronize the JPA project with the specified Java change.
- */
- void javaElementChanged(ElementChangedEvent event);
-
-
-
- // ********** synchronize context model with resource model **********
-
- /**
- * Return the synchronizer that will synchronize the context model with
- * the resource model whenever the resource model changes.
- */
- Synchronizer getContextModelSynchronizer();
-
- /**
- * Set the synchronizer that will keep the context model synchronized with
- * the resource model whenever the resource model changes.
- * Before setting the synchronizer, clients should save the current
- * synchronizer so it can be restored later.
- *
- * @see #getContextModelSynchronizer()
- */
- void setContextModelSynchronizer(Synchronizer synchronizer);
-
- /**
- * The JAXB project's resource model has changed; synchronize the JPA
- * project's context model with it. This method is typically called when the
- * resource model state has changed when it is synchronized with its
- * underlying Eclipse resource as the result of an Eclipse resource change
- * event. This method can also be called when a client (e.g. a JUnit test
- * case) has manipulated the resource model via its API (as opposed to
- * modifying the underlying Eclipse resource directly) and needs the context
- * model to be synchronized accordingly (since manipulating the resource
- * model via its API will not trigger this method). Whether the context
- * model is synchronously (or asynchronously) depends on the current context
- * model synchronizer.
- *
- * @see #synchronizeContextModelAndWait()
- */
- void synchronizeContextModel();
-
- /**
- * Force the JAXB project's context model to synchronize with it resource
- * model <em>synchronously</em>.
- *
- * @see #synchronizeContextModel()
- * @see #updateAndWait()
- */
- void synchronizeContextModelAndWait();
-
- /**
- * This is the callback used by the context model synchronizer to perform
- * the actual "synchronize".
- */
- IStatus synchronizeContextModel(IProgressMonitor monitor);
-
- // ********** project "update" **********
-
- /**
- * Return the synchronizer that will update the context model whenever
- * it has any changes. This allows any intra-JAXB project dependencies to
- * be updated.
- */
- CallbackSynchronizer getUpdateSynchronizer();
-
- /**
- * Set the synchronizer that will update the context model whenever
- * it has any changes. This allows any intra-JAXB project dependencies to
- * be updated.
- * Before setting the update synchronizer, clients should save the current
- * synchronizer so it can be restored later.
- *
- * @see #getUpdateSynchronizer()
- */
- void setUpdateSynchronizer(CallbackSynchronizer synchronizer);
-
- /**
- * Force the JAXB project to "update" <em>synchronously</em>.
- *
- * @see #synchronizeContextModelAndWait()
- */
- void updateAndWait();
-
- /**
- * This is the callback used by the update synchronizer to perform the
- * actual "update".
- */
- IStatus update(IProgressMonitor monitor);
-
-
-
-
-// // ********** utility **********
-//
-// /**
-// * Return an {@link IFile} that best represents the given runtime location
-// */
-// IFile getPlatformFile(IPath runtimePath);
-
-
- // ********** validation **********
-
- /**
- * Return project's validation messages.
- */
- Iterable<IMessage> getValidationMessages(IReporter reporter);
-
-
- // ********** modifying shared documents **********
-
- /**
- * Set a thread-specific implementation of the {@link ExtendedCommandExecutor}
- * interface that will be used to execute a command to modify a shared
- * document. If necessary, the command executor can be cleared by
- * setting it to null.
- * This allows background clients to modify documents that are
- * already present in the UI. See implementations of {@link ExtendedCommandExecutor}.
- */
- void setThreadLocalModifySharedDocumentCommandExecutor(ExtendedCommandExecutor commandExecutor);
-
- /**
- * Return the project-wide implementation of the
- * {@link ExtendedCommandExecutor} interface.
- */
- ExtendedCommandExecutor getModifySharedDocumentCommandExecutor();
-
-
- // ********** construction config **********
-
- /**
- * The settings used to construct a JAXB project.
- */
- interface Config {
-
- /**
- * Return the Eclipse project to be associated with the new JAXB project.
- */
- IProject getProject();
-
- /**
- * Return the JAXB platform definition to be associated with the new JAXB project.
- */
- JaxbPlatformDefinition getPlatformDefinition();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java
deleted file mode 100644
index 68258577ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.model.Model;
-
-
-/**
- * The JAXB project manager holds all the JAXB projects in the workspace.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbProjectManager
- extends Model {
-
- /**
- * Return the JAXB model's JAXB projects.
- */
- Iterable<JaxbProject> getJaxbProjects();
- public static final String JAXB_PROJECTS_COLLECTION = "jaxbProjects"; //$NON-NLS-1$
-
- /**
- * Return the size of the JAXB model's list of JAXB projects.
- */
- int getJaxbProjectsSize();
-
- /**
- * Return the JAXB project corresponding to the specified Eclipse project.
- * Return null if unable to associate the specified Eclipse project
- * with a JAXB project.
- */
- JaxbProject getJaxbProject(IProject project);
-
- /**
- * Return the JAXB file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JAXB file.
- */
- JaxbFile getJaxbFile(IFile file);
-
- /**
- * The JAXB settings associated with the specified Eclipse project
- * have changed in such a way as to require the associated
- * JPA project to be completely rebuilt
- * (e.g. when the user changes a project's JAXB platform).
- */
- void rebuildJaxbProject(IProject project);
-
- /**
- * Return whether the model's Java change listener is active.
- */
- boolean javaElementChangeListenerIsActive();
-
- /**
- * Set whether the model's Java change listener is active.
- */
- void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java
deleted file mode 100644
index 5a7c5eab5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-/**
- * Map a content type to a JAXB resource model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbResourceModelProvider
-{
- /**
- * Return the file content type the provider is for.
- */
- IContentType getContentType();
-
- /**
- * Build a JAXB resource model for the specified JAXB project and file.
- * Use the specified factory for creation so extenders can simply override
- * the appropriate creation method instead of building a provider for the
- * same content.
- */
- JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
deleted file mode 100644
index c284fecf9f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformManagerImpl;
-import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * The Dali JAXB core plug-in lifecycle implementation.
- * A number of globally-available constants and methods.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class JptJaxbCorePlugin
- extends Plugin {
-
- // ********** public constants **********
-
- /**
- * The plug-in identifier of Dali JAXB core
- * (value <code>"org.eclipse.jpt.jaxb.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- /**
- * The identifier for the JAXB validation marker
- * (value <code>"org.eclipse.jpt.jaxb.core.jaxbProblemMarker"</code>).
- */
- public static final String VALIDATION_MARKER_ID = PLUGIN_ID + ".jaxbProblemMarker"; //$NON-NLS-1$
-
- /**
- * The content type for jaxb.index files
- */
- public static final IContentType JAXB_INDEX_CONTENT_TYPE = getJaxbContentType("jaxbIndex");
-
- /**
- * The resource type for jaxb.index files
- */
- public static final JptResourceType JAXB_INDEX_RESOURCE_TYPE = new JptResourceType(JAXB_INDEX_CONTENT_TYPE);
-
- /**
- * The content type for jaxb.properties files
- */
- public static final IContentType JAXB_PROPERTIES_CONTENT_TYPE = getJaxbContentType("jaxbProperties");
-
- /**
- * The resource type for jaxb.properties files
- */
- public static final JptResourceType JAXB_PROPERTIES_RESOURCE_TYPE = new JptResourceType(JAXB_PROPERTIES_CONTENT_TYPE);
-
- private static IContentType getJaxbContentType(String contentType) {
- return getContentType(CONTENT_PREFIX_ + contentType);
- }
-
- public static final String CONTENT_PREFIX = PLUGIN_ID_ + "content"; //$NON-NLS-1$
-
- public static final String CONTENT_PREFIX_ = CONTENT_PREFIX + '.';
-
- private static IContentType getContentType(String contentType) {
- return Platform.getContentTypeManager().getContentType(contentType);
- }
-
-
- // **************** fields ************************************************
-
- private volatile GenericJaxbProjectManager projectManager;
-
-
- // **************** singleton *********************************************
-
- private static JptJaxbCorePlugin INSTANCE;
-
- /**
- * Return the singleton plug-in
- */
- public static JptJaxbCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Return the singular JAXB project manager corresponding to the current workspace.
- */
- public static JaxbProjectManager getProjectManager() {
- return INSTANCE.getProjectManager_();
- }
-
- /**
- * Return the JAXB project corresponding to the specified Eclipse project,
- * or <code>null</code> if unable to associate the specified project with a
- * JAXB project.
- */
- public static JaxbProject getJaxbProject(IProject project) {
- return getProjectManager().getJaxbProject(project);
- }
-
- public static JaxbPlatformManager getJaxbPlatformManager() {
- return JaxbPlatformManagerImpl.instance();
- }
-
- /**
- * Set the default {@link JaxbPlatformDescription} for new JAXB projects with the given
- * JAXB facet version.
- */
- public static void setDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion, JaxbPlatformDescription platform) {
- String preferenceKey = null;
- if (JaxbFacet.VERSION_2_1.equals(jaxbFacetVersion)) {
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (JaxbFacet.VERSION_2_2.equals(jaxbFacetVersion)) {
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- JaxbPreferencesManager.setWorkspacePreference(preferenceKey, platform.getId());
- }
-
- /**
- * Return the default {@link JaxbPlatformDescription} for new JAXB projects with the given
- * JAXB facet version.
- */
- public static JaxbPlatformDescription getDefaultPlatform(IProjectFacetVersion jaxbFacetVersion) {
-
- JaxbPlatformDescription defaultPlatform =
- getDefaultPlatform(
- jaxbFacetVersion,
- JaxbPreferencesManager.getWorkspacePreferences(),
- JaxbPreferencesManager.getDefaultPreferences());
- if (defaultPlatform == null) {
- // if the platform ID stored in the workspace prefs is invalid (i.e. null), look in the default prefs
- defaultPlatform = getDefaultPlatform(jaxbFacetVersion, JaxbPreferencesManager.getDefaultPreferences());
- }
- return defaultPlatform;
- }
-
- //
- private static JaxbPlatformDescription getDefaultPlatform(
- IProjectFacetVersion jaxbFacetVersion, Preferences ... nodes) {
-
- JaxbPlatformDescription defaultDefaultPlatform;
- String preferenceKey;
- if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_1)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_1;
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_2)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_2;
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- return getDefaultPlatform(jaxbFacetVersion, preferenceKey, defaultDefaultPlatform, nodes);
- }
-
- private static JaxbPlatformDescription getDefaultPlatform(
- IProjectFacetVersion jaxbFacetVersion, String preferenceKey,
- JaxbPlatformDescription defaultDefault, Preferences ... nodes) {
-
- String defaultDefaultId = (defaultDefault == null) ? null : defaultDefault.getId();
- String defaultPlatformId = Platform.getPreferencesService().get(preferenceKey, defaultDefaultId, nodes);
- JaxbPlatformDescription defaultPlatform = getJaxbPlatformManager().getJaxbPlatform(defaultPlatformId);
- if (defaultPlatform != null && defaultPlatform.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return defaultPlatform;
- }
- else if (defaultDefault != null && defaultDefault.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return defaultDefault;
- }
- return null;
- }
-
- /**
- * Return the JAXB platform ID associated with the specified Eclipse project.
- */
- public static String getJaxbPlatformId(IProject project) {
- return (new JaxbPreferencesManager(project)).getJaxbPlatformId();
- }
-
- /**
- * Return the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public static JaxbPlatformDescription getJaxbPlatformDescription(IProject project) {
- String jpaPlatformId = getJaxbPlatformId(project);
- return getJaxbPlatformManager().getJaxbPlatform(jpaPlatformId);
- }
-
- /**
- * Set the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public static void setJaxbPlatform(IProject project, JaxbPlatformDescription platform) {
- (new JaxbPreferencesManager(project)).setJaxbPlatform(platform);
- }
-
- public static List<String> getSchemaLocations(IProject project) {
- return (new JaxbPreferencesManager(project)).getSchemaLocations();
- }
-
- public static void setSchemaLocations(IProject project, List<String> schemaLocations) {
- (new JaxbPreferencesManager(project)).setSchemaLocations(schemaLocations);
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **************************************************
-
- public JptJaxbCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // nothing yet...
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- if (this.projectManager != null) {
- this.projectManager.stop();
- this.projectManager = null;
- }
- } finally {
- super.stop(context);
- }
- }
-
- private synchronized GenericJaxbProjectManager getProjectManager_() {
- if (this.projectManager == null) {
- this.projectManager = this.buildProjectManager();
- this.projectManager.start();
- }
- return this.projectManager;
- }
-
- private GenericJaxbProjectManager buildProjectManager() {
- return new GenericJaxbProjectManager();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java
deleted file mode 100644
index 00bc71254d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-/**
- * Identifiers for JAXB class/attribute mapping types
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface MappingKeys {
-
- String XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY = "xml-any-attribute";
- String XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY = "xml-any-element";
- String XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY = "xml-attribute";
- String XML_ELEMENT_ATTRIBUTE_MAPPING_KEY = "xml-element";
- String XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY = "xml-elements";
- String XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY = "xml-element-ref";
- String XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY = "xml-element-refs";
- String XML_MIXED_ATTRIBUTE_MAPPING_KEY = "xml-mixed";
- String XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY = "xml-transient";
- String XML_VALUE_ATTRIBUTE_MAPPING_KEY = "xml-value";
-
- /** mapping key for attribute mappings that are unrecognized */
- String NULL_ATTRIBUTE_MAPPING_KEY = null;
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java
deleted file mode 100644
index df2686c56c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-/**
- * Schema configuration object for {@link SchemaLibrary}
- *
- * @noimplement
- * @version 3.1
- * @since 3.1
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaEntry {
-
- /**
- * Return the location key of the entry.
- * This could be:
- * - a web location (that then redirects to a plugin resource location)
- * - a workspace location
- * - a namespace
- */
- String getLocation();
-
- /**
- * Return the namespace of the schema
- */
- String getNamespace();
-
- /**
- * Return whether the schema referred to by the entry is loaded
- */
- boolean isLoaded();
-
- /**
- * Return the {@link XsdSchema} associated with the entry.
- * The provided namespace is a last failsafe check that the loaded schema does in fact
- * have the namespace in question.
- * (Sometimes on a refresh the schema will turn out to have a different namespace than expected)
- */
- XsdSchema getXsdSchema(String namespace);
-
- /**
- * Refresh the associated schema
- */
- void refresh();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java
deleted file mode 100644
index f6ab0c18d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.List;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-/**
- * Entry point for accessing project schema resources
- *
- * @noimplement
- * @version 3.1
- * @since 3.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaLibrary {
-
- /**
- * Return the schema entries that have been added to the project settings for validation purposes
- */
- public List<SchemaEntry> getSchemaEntries();
-
- /**
- * Return the locations associated with the schema entries
- */
- public List<String> getSchemaLocations();
-
- /**
- * Set the schema locations
- */
- public void setSchemaLocations(List<String> schemaLocations);
-
- /**
- * Return the XsdSchema identified by the given namespace, if it exists and is resolvable.
- * If there are multiple schemas with the given namespace, return the first one found.
- * Return null otherwise.
- */
- public XsdSchema getSchema(String namespace);
-
- /**
- * Refresh the schema with the given namespace, if it exists and is resolvable.
- * Refresh the first one found if there are multiple schemas for the namespace.
- * Do nothing otherwise.
- */
- public void refreshSchema(String namespace);
-
- /**
- * Refresh all schemas within the library.
- */
- public void refreshAllSchemas();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java
deleted file mode 100644
index 3aa84db340..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB accessor (field/property).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface Accessor
- extends JavaContextNode {
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- /**
- * Return the type name of the java attribute, or the item type name of a collection or array.
- */
- String getJavaResourceAttributeBaseTypeName();
-
- /**
- * (See JAXB 2.2 Spec, sect. 5.5.2)
- * Return true if the java attribute type is an extension of java.util.Collection or a single
- * dimensional array (except for byte[], which is treated like a non-array)
- */
- boolean isJavaResourceAttributeCollectionType();
-
- /**
- * Return whether the java resource attribute type is a subtype of the given type
- * This might not return the same thing as getJavaResourceAttribute().typeIsSubTypeOf(String).
- */
- boolean isJavaResourceAttributeTypeSubTypeOf(String typeName);
-
-
- //**************** static methods *****************
-
- final class AccessorTools {
-
- public static final String BYTE_ARRAY_CLASS_NAME = "byte[]";
- public static final String COLLECTION_CLASS_NAME = Collection.class.getName();
- public static final String OBJECT_CLASS_NAME = Object.class.getName();
-
- public static String getBaseTypeName(JavaResourceAttribute attribute) {
- if (attribute.typeIsArray()) {
- if (BYTE_ARRAY_CLASS_NAME.equals(attribute.getTypeName())) {
- return BYTE_ARRAY_CLASS_NAME;
- }
- else if (attribute.getTypeArrayDimensionality() == 1) {
- return attribute.getTypeArrayComponentTypeName();
- }
- }
- else if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- if (attribute.getTypeTypeArgumentNamesSize() == 1) {
- return attribute.getTypeTypeArgumentName(0);
- }
- return OBJECT_CLASS_NAME;
- }
- return attribute.getTypeName();
- }
-
- /**
- * @see JaxbPersistentAttribute#isJavaResourceAttributeCollectionType()
- */
- public static boolean isCollectionType(JavaResourceAttribute attribute) {
- if (attribute.typeIsArray()) {
- if (attribute.getTypeArrayDimensionality() == 1
- && ! BYTE_ARRAY_CLASS_NAME.equals(attribute.getTypeName())) {
- return true;
- }
- return false;
- }
- else if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- return true;
- }
-
- return false;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java
deleted file mode 100644
index b9e8340c67..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-
-/**
- * Represents a JAXB attribute mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface JaxbAttributeMapping
- extends JavaContextNode {
-
- String getKey();
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- JaxbPersistentAttribute getPersistentAttribute();
-
- JaxbClassMapping getClassMapping();
-
-
- // ***** default *****
-
- String DEFAULT_PROPERTY = "default"; //$NON-NLS-1$
-
- /**
- * Return whether the mapping is its attribute's <em>default</em> mapping
- * (as opposed to its <em>specified</em> mapping).
- */
- boolean isDefault();
-
-
- // ***** misc *****
-
- /**
- * Return the (fully qualified) type of the attribute
- * (or the item type if in a collection/array)
- */
- String getBoundTypeName();
-
- /**
- * Return the (fully qualified) type used to map the bound type.
- * (Usually the same as the value type, except when an XmlJavaTypeAdapter is used.)
- */
- String getValueTypeName();
-
- /**
- * Return the (fully qualified) type of the data actually written to xml.
- * (Usually the same as the value type, except when an XmlIDREF is used.)
- */
- String getDataTypeName();
-
- /**
- * Return the schema type associated with the value type. May be null.
- */
- XsdTypeDefinition getDataTypeXsdTypeDefinition();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- /**
- * Return whether the attribute is mapped to a particle
- * (e.g. XmlElement, XmlElements, XmlElementRef, XmlElementRefs)
- */
- boolean isParticleMapping();
-
- /**
- * Return whether the attribute is specifically excluded from being mapped
- * (e.g. XmlTransient)
- */
- boolean isTransient();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
deleted file mode 100644
index 5f9e757bcd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Holds the attributes represented by a particular JavaResourceType and XmlAccessType.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbAttributesContainer
- extends JavaContextNode {
-
- /**
- * Return true if this JaxbAtributesContainer contains attributes for the given JavaResourceType.
- */
- boolean isFor(JavaResourceType javaResourceType);
-
-
- /********** attributes **********/
-
- Iterable<JaxbPersistentAttribute> getAttributes();
-
- int getAttributesSize();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java
deleted file mode 100644
index 6a85bf3de7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-
-/**
- * Represents a <i>class</i> in a JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbClass
- extends JaxbType {
-
- // ***** overrides *****
-
- JavaResourceType getJavaResourceType();
-
- public JaxbClassMapping getMapping();
-
-
- // ***** XmlRegistry *****
-
- String XML_REGISTRY_PROPERTY = "xmlRegistry"; //$NON-NLS-1$
-
- XmlRegistry getXmlRegistry();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java
deleted file mode 100644
index ec286a8701..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-
-public interface JaxbClassMapping
- extends JaxbTypeMapping, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- // ***** overrides *****
-
- JaxbClass getJaxbType();
-
-
- // ***** XmlType.factoryClass *****
-
- String getFactoryClass();
-
- String SPECIFIED_FACTORY_CLASS_PROPERTY = "specifiedFactoryClass"; //$NON-NLS-1$
-
- /**
- * factory class corresponds to the XmlType annotation factoryClass element
- */
- String getSpecifiedFactoryClass();
-
- void setSpecifiedFactoryClass(String factoryClass);
-
-
- // ***** XmlType.factoryMethod *****
-
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * factory method corresponds to the XmlType annotation factoryMethod element
- */
- String getFactoryMethod();
-
- void setFactoryMethod(String factoryMethod);
-
-
- // ***** XmlType.propOrder *****
-
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * propOrder corresponds to the XmlType annotation propOrder element
- */
- ListIterable<String> getPropOrder();
-
- String getProp(int index);
-
- int getPropOrderSize();
-
- void addProp(int index, String prop);
-
- void removeProp(int index);
-
- void removeProp(String prop);
-
- void moveProp(int targetIndex, int sourceIndex);
-
-
- // ***** superclass *****
-
- String SUPERCLASS_PROPERTY = "superclass"; //$NON-NLS-1$
-
- JaxbClassMapping getSuperclass();
-
-
- // ***** attributes *****
-
- String ATTRIBUTES_COLLECTION = "attributes"; //$NON-NLS-1$
-
- Iterable<JaxbPersistentAttribute> getAttributes();
-
- int getAttributesSize();
-
-
- // ***** included attributes *****
-
- String INCLUDED_ATTRIBUTES_COLLECTION = "includedAttributes"; //$NON-NLS-1$
-
- /**
- * <i>Included</i> attributes come from any direct superclasses that are mapped as @XmlTransient.
- * (As opposed to <i>inherited</i> attributes, which a class has by way of <i>any</i> mapped superclasses.)
- * If there is an intervening class that is not transient, then that class will hold any
- * included attributes from any direct superclass that are mapped as @XmlTransient.
- * @see JaxbClassMapping#getSuperclass()
- */
- Iterable<JaxbPersistentAttribute> getIncludedAttributes();
-
- int getIncludedAttributesSize();
-
-
- // ***** misc attributes *****
-
- /**
- * Return all attributes that are defined by this class.
- * This is the combined set of #getAttributes() and #getIncludedAttributes()
- */
- Iterable<JaxbPersistentAttribute> getAllLocallyDefinedAttributes();
-
- /**
- * <i>Inherited</i> attributes are any attributes this class mapping has whose source
- * is a superclass.
- * Inherited attributes include <i>included</i> attributes.
- */
- Iterable<JaxbPersistentAttribute> getInheritedAttributes();
-
-
- // ***** misc *****
-
- /**
- * Return the id attribute mapping for this class mapping, if it has one.
- * (Will return the first one it finds, if this class has more than one.)
- */
- JaxbAttributeMapping getXmlIdMapping();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
deleted file mode 100644
index 9918f02d62..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-
-/**
- * Common protocol for JAXB objects that have a context, as opposed to
- * resource objects.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbContextNode
- extends JaxbNode {
-
- /**
- * Return the root of the context model
- */
- JaxbContextRoot getContextRoot();
-
- /**
- * Return the resource type of the context node's resource.
- */
- JptResourceType getResourceType();
-
-
- // ********** updating **********
-
- void synchronizeWithResourceModel();
-
- /**
- * Update the context model with the content of the JAXB resource model.
- */
- void update();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
deleted file mode 100644
index f203a01b64..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Root of the JAXB context model.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbContextRoot
- extends JaxbContextNode {
-
- // ***** packages *****
-
- static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
-
- /**
- * The set of packages. Includes any package with any interesting JAXB content.
- */
- Iterable<JaxbPackage> getPackages();
-
- /**
- * Return the package with the given name
- */
- JaxbPackage getPackage(String packageName);
-
- int getPackagesSize();
-
-
- // ***** jaxb types *****
-
- public final static String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Return the set of all JAXB types within this context root.
- */
- Iterable<JaxbType> getTypes();
-
- /**
- * Return the type with the given (fully qualified) type name
- */
- JaxbType getType(String typeName);
-
- int getTypesSize();
-
- /**
- * Return the set of types that are in the given package
- */
- Iterable<JaxbType> getTypes(JaxbPackage jaxbPackage);
-
- /**
- * The set of jaxb classes. These may be explicitly or implicitly included.
- */
- Iterable<JaxbClass> getClasses();
-
- /**
- * Return the set of jaxb classes that are in the given package
- */
- Iterable<JaxbClass> getClasses(JaxbPackage jaxbPackage);
-
- /**
- * The set of jaxb enums. These may be explicitly or implicitly included.
- */
- Iterable<JaxbEnum> getEnums();
-
- /**
- * Return the set of jaxb enums that are in the given package
- */
- Iterable<JaxbEnum> getEnums(JaxbPackage jaxbPackage);
-
- /**
- * Return the set of {@link XmlRegistry}(ie)s that are in the given package
- */
- Iterable<XmlRegistry> getXmlRegistries(JaxbPackage jaxbPackage);
-
- /**
- * Return the {@link JaxbTypeMapping} for the given (fully qualified) type name
- */
- JaxbTypeMapping getTypeMapping(String typeName);
-
- /**
- * Return the {@link JaxbClassMapping} for the given (fully qualified) type name
- */
- JaxbClassMapping getClassMapping(String typeName);
-
-
- // ***** misc *****
-
-
-
-
- // ***** validation *****
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
deleted file mode 100644
index 563907c44a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB element factory method
- * (A method inside an object factory (@XmlRegistry) with an explicit @XmlElementDecl annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbElementFactoryMethod
- extends JavaContextNode {
-
- JavaResourceMethod getResourceMethod();
-
- /**
- * Return the method name
- */
- String getName();
-
-
- // ***** scope *****
-
- /**
- * Corresponds to the XmlElementDecl annotation 'scope' element
- */
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- String getScope();
-
- void setScope(String scope);
-
- String DEFAULT_SCOPE_CLASS_NAME = "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"; //$NON-NLS-1$
-
- String getFullyQualifiedScope();
-
- /**
- * Return true if the scope is default or is specified to be XmlElementDecl.GLOBAL.
- */
- boolean isGlobalScope();
-
-
- // ***** qName *****
-
- JaxbQName getQName();
-
-
- // ***** substitution head qName *****
-
- JaxbQName getSubstitutionHeadQName();
-
-
- // ***** default value *****
-
- /**
- * Corresponds to the XmlElementDecl annotation 'defaultValue' element
- */
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- void setDefaultValue(String defaultValue);
-
- String DEFAULT_DEFAULT_VALUE = "\u0000"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java
deleted file mode 100644
index 5a98a688b8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-
-/**
- * Represents an <i>enum</i> in a JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbEnum
- extends JaxbType {
-
- // ***** covariant overrides *****
-
- JavaResourceEnum getJavaResourceType();
-
- public JaxbEnumMapping getMapping();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
deleted file mode 100644
index f84439f633..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB enum constant.
- * (A constant inside an enum with either an explicit or implicit @XmlEnumValue annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbEnumConstant
- extends JavaContextNode {
-
- JavaResourceEnumConstant getResourceEnumConstant();
-
- /**
- * Return the name of the enum constant. This will not change, a
- * new JaxbEnumConstant will be built if the name changes.
- */
- String getName();
-
-
- /**
- * Return the enum constant's value, whether specified or default.
- */
- String getValue();
-
- /**
- * The default value will be the name of the enum constant.
- * It will be used if the XmlEnumValue annotation is null.
- * @see getName()
- */
- String getDefaultValue();
-
- /**
- * Corresponds to the XmlEnumValue annotation 'value' element
- */
- String getSpecifiedValue();
- void setSpecifiedValue(String value);
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java
deleted file mode 100644
index 7d3b1db097..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-
-/**
- * Represents mapping metadata on an enum (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbEnumMapping
- extends JaxbTypeMapping {
-
- // ***** XmlEnum.value *****
-
- /**
- * Return the type specified for the XmlEnum.value, or "java.lang.String" if unspecified
- */
- String getXmlEnumValue();
-
- String SPECIFIED_XML_ENUM_VALUE_PROPERTY = "specifiedXmlEnum"; //$NON-NLS-1$
-
- /**
- * Return the value of the XmlEnum.value element
- */
- String getSpecifiedXmlEnumValue();
-
- void setSpecifiedXmlEnumValue(String xmlEnumValue);
-
- /**
- * Return the value of the XmlEnum.value element, taking into consideration imports
- */
- String getFullyQualifiedXmlEnumValue();
-
- String DEFAULT_XML_ENUM_VALUE = "java.lang.String"; //$NON-NLS-1$
-
-
- // ***** enum constants *****
-
- String ENUM_CONSTANTS_COLLECTION = "enumConstants"; //$NON-NLS-1$
-
- Iterable<JaxbEnumConstant> getEnumConstants();
-
- int getEnumConstantsSize();
-
-
- // ***** misc *****
-
- XsdSimpleTypeDefinition getValueXsdTypeDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
deleted file mode 100644
index 739cbe8806..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPackage
- extends JaxbContextNode {
-
- /**
- * The package name.
- * This is unchanging in that, if a package name changes, a new JaxbPackage is created.
- */
- String getName();
-
- /**
- * The optional package-info
- */
- JaxbPackageInfo getPackageInfo();
- public final static String PACKAGE_INFO_PROPERTY = "package-info"; //$NON-NLS-1$
-
- /**
- * Return the namespace associated with this package, default or specified
- */
- String getNamespace();
-
- /**
- * Return the attribute form default associated with this package
- */
- XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the element form default associated with this package
- */
- XmlNsForm getElementFormDefault();
-
- /**
- * Return whether this package has no useful information.
- * Useful information includes:
- * - annotated package-info.java
- * - jaxb.index
- * - object factory
- */
- boolean isEmpty();
-
- /**
- * Return the {@link XmlRegistry} for this package if there is one.
- * Return *one* if there are more than one (which is an error case at any rate)
- */
- XmlRegistry getRegistry();
-
- /**
- * Return the {@link XsdSchema} associated with this package, if there is one, null otherwise
- */
- XsdSchema getXsdSchema();
-
-
- // **************** validation ********************************************
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
deleted file mode 100644
index 062c95439f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbPackageInfo
- extends JavaContextNode, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- JavaResourcePackage getResourcePackage();
-
- JaxbPackage getJaxbPackage();
-
-
- // ***** XmlSchema *****
-
- /**
- * Return the XML schema for this package info, this will not be null.
- */
- XmlSchema getXmlSchema();
-
-
- // ***** XmlSchemaTypes *****
-
- String XML_SCHEMA_TYPES_LIST = "xmlSchemaTypes"; //$NON-NLS-1$
-
- ListIterable<XmlSchemaType> getXmlSchemaTypes();
-
- int getXmlSchemaTypesSize();
-
- XmlSchemaType addXmlSchemaType(int index);
-
- void removeXmlSchemaType(int index);
-
- void removeXmlSchemaType(XmlSchemaType xmlSchemaType);
-
- void moveXmlSchemaType(int targetIndex, int sourceIndex);
-
-
- // ***** XmlJavaTypeAdapters ******
-
- String XML_JAVA_TYPE_ADAPTERS_LIST = "xmlJavaTypeAdapters"; //$NON-NLS-1$
-
- ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters();
-
- int getXmlJavaTypeAdaptersSize();
-
- XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index);
-
- void removeXmlJavaTypeAdapter(int index);
-
- void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlJavaTypeAdapter);
-
- void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex);
-
- /**
- * return an {@link XmlJavaTypeAdapter} for the given bound type name, if one exists
- */
- XmlJavaTypeAdapter getXmlJavaTypeAdapter(String boundTypeName);
-
-
- // ***** misc *****
-
- String getNamespaceForPrefix(String prefix);
-
- String getPrefixForNamespace(String namespace);
-
-
- // ***** validation *****
-
- /**
- * Add validation messages to the specified list.
- */
- void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
deleted file mode 100644
index d9321a53e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB attribute (field/property).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPersistentAttribute
- extends JavaContextNode {
-
- JaxbClassMapping getClassMapping();
-
-
- // ***** declaring class/ inheritance *****
-
- /**
- * Return the resource type where the source of the attribute is declared.
- * This may not be where the attribute is fully defined, as it may be inherited
- */
- JavaResourceType getDeclaringJavaResourceType();
-
- /**
- * Return true if the source of the attribute is defined in a superclass
- */
- boolean isInherited();
-
-
- // ***** name *****
-
- /**
- * Return the name of the attribute. This will not change, a
- * new JaxbPersistentAttribute will be built if the name changes.
- */
- String getName();
-
-
- // ***** resource attribute *****
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- /**
- * Return the type name of the java attribute, or the item type name of a collection or array.
- */
- String getJavaResourceAttributeBaseTypeName();
-
- /**
- * (See JAXB 2.2 Spec, sect. 5.5.2)
- * Return true if the java attribute type is an extension of java.util.Collection or a single
- * dimensional array (except for byte[], which is treated like a non-array)
- */
- boolean isJavaResourceAttributeCollectionType();
-
- /**
- * Return whether the java resource attribute type is a subtype of the given type
- * This might not return the same thing as getJavaResourceAttribute().typeIsSubTypeOf(String).
- */
- boolean isJavaResourceAttributeTypeSubTypeOf(String typeName);
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
-
- // ********** mapping **********
-
- /**
- * Return the attribute's mapping. This is never <code>null</code>
- * (although, it may be a <em>null</em> mapping).
- * Set the mapping via {@link PersistentAttribute#setMappingKey(String)}.
- */
- JaxbAttributeMapping getMapping();
- String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- /**
- * Return the attribute's mapping key.
- */
- String getMappingKey();
-
- /**
- * Set the attribute's mapping.
- * If the specified key is <code>null</code>, clear the specified mapping,
- * allowing the attribute's mapping to default (if appropriate).
- * Return the new mapping (which may be a <em>null</em> mapping).
- */
- JaxbAttributeMapping setMappingKey(String key);
-
- /**
- * Return the key for the attribute's default mapping.
- * This can be <code>null</code> (e.g. for <em>specified</em>
- * <code>orm.xml</code> attributes).
- * @see JaxbAttributeMapping#isDefault()
- */
- String getDefaultMappingKey();
- String DEFAULT_MAPPING_KEY_PROPERTY = "defaultMappingKey"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java
deleted file mode 100644
index 5ef41785db..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a namespace, name pairing
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.?
- */
-public interface JaxbQName
- extends JavaContextNode {
-
- // ***** namespace *****
-
- static String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- String getNamespace();
-
- String getDefaultNamespace();
-
- String getSpecifiedNamespace();
-
- void setSpecifiedNamespace(String namespace);
-
-
- // ***** name *****
-
- static String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- String getName();
-
- String getDefaultName();
-
- String getSpecifiedName();
-
- void setSpecifiedName(String name);
-
-
- // ***** validation *****
-
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- TextRange getNameTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
deleted file mode 100644
index 656bef92af..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Represents a java class (or enum or interface) with JAXB metadata (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbType
- extends JavaContextNode, XmlAdaptable {
-
- // ***** kind *****
-
- Kind getKind();
-
-
- // ***** type mapping *****
-
- final String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- /**
- * Return the mapping of this type.
- * May be null.
- * Will <b>not</b> be null if this type has an XmlType annotation (or other mapping annotation)
- * or if this type is default mapped.
- */
- JaxbTypeMapping getMapping();
-
-
- // ***** default mapped *****
-
- final String DEFAULT_MAPPED_PROPERTY = "defaultMapped"; //$NON-NLS-1$
-
- /**
- * Return true if this type is mapped by reference.
- * (If this type has a default mapping by virtue of it being referenced by another mapped type.)
- */
- boolean isDefaultMapped();
-
- /**
- * Set this to <code>true</code> if this type is referenced by another mapped type.
- * (NB: should only be called by {@link JaxbContextRoot} object.)
- */
- void setDefaultMapped(boolean newValue);
-
-
- /**
- * Return the associated java resource type
- */
- JavaResourceAbstractType getJavaResourceType();
-
- /**
- * Return the name of the type without any package or type qualifiers
- */
- String getSimpleName();
-
- /**
- * Returns the type-qualified name of this type, including qualification for any
- * enclosing types, but not including package qualification.
- */
- String getTypeQualifiedName();
-
- /**
- * Returns the fully qualified name of this type, including qualification for any
- * enclosing types and packages.
- */
- String getFullyQualifiedName();
-
- /**
- * Return the name of the type's package. Empty string if none.
- */
- String getPackageName();
-
- /**
- * Return the {@link JaxbPackage} associated with this type
- * (NB: may be null in some partially built cases)
- */
- JaxbPackage getJaxbPackage();
-
- /**
- * Return the {@link JaxbPackageInfo} associated with this type, if it exists
- */
- JaxbPackageInfo getJaxbPackageInfo();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
-
- // ****** validation *****
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
-
- public enum Kind {
-
- /**
- * {@link JaxbType}s of {@link Kind} CLASS may safely be cast as {@link JaxbClass}
- */
- CLASS,
-
- /**
- * {@link JaxbType}s of {@link Kind} ENUM may safely be cast as {@link JaxbEnum}
- */
- ENUM;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java
deleted file mode 100644
index 2aa4110064..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-/**
- * Represents mapping metadata on a JaxbType (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbTypeMapping
- extends JavaContextNode {
-
- // ***** JaxbType *****
-
- JaxbType getJaxbType();
-
-
- // ***** XmlTransient *****
-
- String XML_TRANSIENT_PROPERTY = "xmlTransient"; //$NON-NLS-1$
-
- boolean isXmlTransient();
-
- void setXmlTransient(boolean newValue);
-
-
- // ***** XmlType.name and XmlType.namespace *****
-
- JaxbQName getQName();
-
-
- // ***** XmlRootElement *****
-
- String XML_ROOT_ELEMENT_PROPERTY = "xmlRootElement"; //$NON-NLS-1$
-
- XmlRootElement getXmlRootElement();
-
- XmlRootElement addXmlRootElement();
-
- void removeXmlRootElement();
-
-
- // ***** XmlSeeAlso *****
-
- String XML_SEE_ALSO_PROPERTY = "xmlSeeAlso"; //$NON-NLS-1$
-
- XmlSeeAlso getXmlSeeAlso();
-
- XmlSeeAlso addXmlSeeAlso();
-
- void removeXmlSeeAlso();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- XsdTypeDefinition getXsdTypeDefinition();
-
- /**
- * Return true if this class or a subclass (if it can have subclasses) has a root element defined
- */
- boolean hasRootElementInHierarchy();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java
deleted file mode 100644
index 7c3a887420..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Access Order
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessOrder {
-
- ALPHABETICAL(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.ALPHABETICAL
- ),
- UNDEFINED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder;
-
- XmlAccessOrder(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- if (javaAccessOrder == null) {
- throw new NullPointerException();
- }
- this.javaAccessOrder = javaAccessOrder;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder getJavaAccessOrder() {
- return this.javaAccessOrder;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessOrder fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- return (javaAccessOrder == null) ? null : fromJavaResourceModel_(javaAccessOrder);
- }
-
- private static XmlAccessOrder fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- for (XmlAccessOrder accessOrder : XmlAccessOrder.values()) {
- if (accessOrder.getJavaAccessOrder() == javaAccessOrder) {
- return accessOrder;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder toJavaResourceModel(XmlAccessOrder accessOrder) {
- return (accessOrder == null) ? null : accessOrder.getJavaAccessOrder();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java
deleted file mode 100644
index 6fa5eae416..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessOrderHolder
- extends JaxbContextNode {
-
- /**
- * Return the access order, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- XmlAccessOrder getAccessOrder();
-
- /**
- * String constant associated with changes to the default access order
- */
- String DEFAULT_ACCESS_ORDER_PROPERTY = "defaultAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the default access order, never null
- */
- XmlAccessOrder getDefaultAccessOrder();
-
- /**
- * String constant associated with changes to the specified access order
- */
- String SPECIFIED_ACCESS_ORDER_PROPERTY = "specifiedAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the specified access order;
- */
- XmlAccessOrder getSpecifiedAccessOrder();
-
- /**
- * Set the specified access order.
- */
- void setSpecifiedAccessOrder(XmlAccessOrder newSpecifiedAccessOrder);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java
deleted file mode 100644
index b2c8fd639a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Access Type
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessType {
-
- FIELD(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD
- ),
- NONE(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE
- ),
- PROPERTY(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PROPERTY
- ),
- PUBLIC_MEMBER(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType;
-
- XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- if (javaAccessType == null) {
- throw new NullPointerException();
- }
- this.javaAccessType = javaAccessType;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType getJavaAccessType() {
- return this.javaAccessType;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessType fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- return (javaAccessType == null) ? null : fromJavaResourceModel_(javaAccessType);
- }
-
- private static XmlAccessType fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- for (XmlAccessType accessType : XmlAccessType.values()) {
- if (accessType.getJavaAccessType() == javaAccessType) {
- return accessType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType toJavaResourceModel(XmlAccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAccessType();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java
deleted file mode 100644
index 6a562650ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessTypeHolder
- extends JaxbContextNode {
-
- /**
- * Return the access type, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- XmlAccessType getAccessType();
-
- /**
- * String constant associated with changes to the default access type
- */
- String DEFAULT_ACCESS_TYPE_PROPERTY = "defaultAccessType"; //$NON-NLS-1$
-
- /**
- * Return the default access type, never null
- */
- XmlAccessType getDefaultAccessType();
-
- /**
- * String constant associated with changes to the specified access type
- */
- String SPECIFIED_ACCESS_TYPE_PROPERTY = "specifiedAccessType"; //$NON-NLS-1$
-
- /**
- * Return the specified access type;
- */
- XmlAccessType getSpecifiedAccessType();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedAccessType(XmlAccessType newSpecifiedAccessType);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java
deleted file mode 100644
index 1597b485f7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-public interface XmlAdaptable
- extends JavaContextNode {
-
- // ***** XmlJavaTypeAdapter *****
-
- String XML_JAVA_TYPE_ADAPTER_PROPERTY = "xmlJavaTypeAdapter"; //$NON-NLS-1$
-
- XmlJavaTypeAdapter getXmlJavaTypeAdapter();
-
- XmlJavaTypeAdapter addXmlJavaTypeAdapter();
-
- void removeXmlJavaTypeAdapter();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java
deleted file mode 100644
index 3ba89d68a9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents an attribute mapping that may also have an XmlJavaTypeAdapter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlAdaptableMapping
- extends XmlAdaptable {
-
- /**
- * Return either the {@link XmlAdapter} defined here or any XmlAdapter defined at a higher level
- * that also applies here.
- */
- XmlAdapter getXmlAdapter();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java
deleted file mode 100644
index 99fc144c4b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-
-/**
- * Represents a java class used as an XmlAdapter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAdapter
- extends JaxbContextNode {
-
- static String MARSHAL_METHOD_NAME = "marshal"; //$NON-NLS-1$
-
-
- // ***** bound type *****
-
- /**
- * String associated with changes to the "boundType" property
- */
- static String BOUND_TYPE_PROPERTY = "boundType"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified bound type name (the type used in the java model)
- */
- String getBoundType();
-
-
- // ***** value type *****
-
- /**
- * String associated with changes to the "valueType" property
- */
- static String VALUE_TYPE_PROPERTY = "valueType"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified value type name (the type that corresponds to the xml schema)
- */
- String getValueType();
-
-
- // ***** misc *****
-
- JavaResourceType getJavaResourceType();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java
deleted file mode 100644
index d118b04ae4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml any attribute mapping (@XmlAnyAttribute)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyAttributeMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java
deleted file mode 100644
index f5695b1007..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml any element mapping (@XmlAnyElement)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyElementMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** lax *****
-
- boolean isLax();
-
- String SPECIFIED_LAX_PROPERTY = "specifiedLax"; //$NON-NLS-1$
-
- Boolean getSpecifiedLax();
-
- void setSpecifiedLax(Boolean specifiedLax);
-
- boolean isDefaultLax();
-
- boolean DEFAULT_LAX = false;
-
-
- // ***** value *****
-
- String getValue();
-
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
-
- String getSpecifiedValue();
-
- void setSpecifiedValue(String value);
-
- String DEFAULT_TYPE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- String DEFAULT_VALUE = "javax.xml.bind.annotation.W3CDomHandler"; //$NON-NLS-1$
-
-
- // ***** XmlElementRefs *****
-
- XmlElementRefs getXmlElementRefs();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java
deleted file mode 100644
index 903e3c246f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XmlAttachmentRef
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttachmentRef
- extends JavaContextNode {
-
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java
deleted file mode 100644
index a3c6ca9396..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml attribute mapping (@XmlAttribute)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttributeMapping
- extends XmlNamedNodeMapping {
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java
deleted file mode 100644
index 333cbcf353..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-
-/**
- * Represents an @XmlElement, whether at top level or nested in @XmlElements
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElement
- extends JavaContextNode {
-
- // ***** annotation *****
-
- XmlElementAnnotation getAnnotation(boolean createIfNull);
-
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** nillable *****
-
- boolean isNillable();
-
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- Boolean getSpecifiedNillable();
-
- void setSpecifiedNillable(Boolean specifiedNillable);
-
- String DEFAULT_NILLABLE_PROPERTY = "defaultNillable"; //$NON-NLS-1$
-
- boolean isDefaultNillable();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
-
- // ***** default value *****
-
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- void setDefaultValue(String defaultValue);
-
-
- // ***** type *****
-
- String getType();
-
- String getFullyQualifiedType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- /**
- * Return the schema element declaration referenced, if it can be resolved.
- */
- XsdElementDeclaration getXsdElement();
-
-
- // ***** validation *****
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java
deleted file mode 100644
index 33a293f4b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents a JAXB xml element mapping (@XmlElement)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementMapping
- extends XmlNamedNodeMapping {
-
- XmlElement getXmlElement();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
deleted file mode 100644
index 9a713bba4a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * Represents an @XmlElementRef, whether at top level or nested in @XmlElementRefs
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRef
- extends JavaContextNode {
-
- // ***** annotation *****
-
- XmlElementRefAnnotation getAnnotation();
-
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
-
- // ***** type *****
-
- String getType();
-
- String getFullyQualifiedType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
-
- // ***** validation *****
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java
deleted file mode 100644
index 51c8cd587d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents a JAXB xml element ref mapping (@XmlElementRef)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRefMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElementRef *****
-
- XmlElementRef getXmlElementRef();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java
deleted file mode 100644
index 01d8fdba14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-public interface XmlElementRefs
- extends JavaContextNode {
-
- // ***** XmlElementRefs *****
-
- String XML_ELEMENT_REFS_LIST = "xmlElementRefs"; //$NON-NLS-1$
-
- ListIterable<XmlElementRef> getXmlElementRefs();
-
- int getXmlElementRefsSize();
-
- XmlElementRef addXmlElementRef(int index);
-
- void removeXmlElementRef(int index);
-
- void removeXmlElementRef(XmlElementRef xmlElementRef);
-
- void moveXmlElementRef(int targetIndex, int sourceIndex);
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java
deleted file mode 100644
index 14a4a55934..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml element refs mapping (@XmlElementRefs)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRefsMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElementRefs *****
-
- XmlElementRefs getXmlElementRefs();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
deleted file mode 100644
index 2f227762d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-
-
-/**
- * Represents a JAXB XML element wrapper
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementWrapper
- extends JavaContextNode {
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** nillable *****
-
- boolean isNillable();
-
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- Boolean getSpecifiedNillable();
-
- void setSpecifiedNillable(Boolean specifiedNillable);
-
- boolean isDefaultNillable();
-
- boolean DEFAULT_NILLABLE = false;
-
-
- // ***** required *****
-
- boolean isRequired();
-
- String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
- boolean DEFAULT_REQUIRED = false;
-
-
- // ***** misc *****
-
- XsdElementDeclaration getXsdElementDeclaration();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java
deleted file mode 100644
index fd4bd249ee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Represents a JAXB xml elements mapping (@XmlElements)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementsMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElements *****
-
- String XML_ELEMENTS_LIST = "xmlElements"; //$NON-NLS-1$
-
- ListIterable<XmlElement> getXmlElements();
-
- int getXmlElementsSize();
-
- XmlElement addXmlElement(int index);
-
- void removeXmlElement(int index);
-
- void removeXmlElement(XmlElement xmlElement);
-
- void moveXmlElement(int targetIndex, int sourceIndex);
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlIDREF *****
-
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
- XmlIDREF getXmlIDREF();
-
- XmlIDREF addXmlIDREF();
-
- void removeXmlIDREF();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java
deleted file mode 100644
index 83169f9133..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML ID (@XmlID)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlID
- extends JavaContextNode {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java
deleted file mode 100644
index 5eaefd3d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML ID ref (@XmlIDREF)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDREF
- extends JavaContextNode {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
deleted file mode 100644
index a7b342bdbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface XmlJavaTypeAdapter
- extends JavaContextNode {
-
- XmlJavaTypeAdapterAnnotation getAnnotation();
-
-
- // ***** value *****
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- String getValue();
-
- void setValue(String value);
-
- String getFullyQualifiedValue();
-
-
- // ***** xmlAdapter *****
-
- String XML_ADAPTER_PROPERTY = "xmlAdapter"; //$NON-NLS-1$
-
- /**
- * Object based on specified "value"
- */
- XmlAdapter getXmlAdapter();
-
-
- // ***** type *****
-
- String getType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
- String getFullyQualifiedType();
-
- String DEFAULT_TYPE = "javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
deleted file mode 100644
index dfc6df927a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents the @XmlMixed JAXB annotation
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMixed
- extends JavaContextNode {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java
deleted file mode 100644
index 6efc373067..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-
-/**
- * Common interface for XmlElementMapping and XmlAttributeMapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlNamedNodeMapping
- extends XmlNodeMapping {
-
- // ***** XmlID *****
-
- String XML_ID_PROPERTY = "xmlID"; //$NON-NLS-1$
-
- XmlID getXmlID();
-
- XmlID addXmlID();
-
- void removeXmlID();
-
-
- // ***** XmlIDREF *****
-
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
- XmlIDREF getXmlIDREF();
-
- XmlIDREF addXmlIDREF();
-
- void removeXmlIDREF();
-
-
- // ***** XmlAttachmentRef *****
-
- String XML_ATTACHMENT_REF_PROPERTY = "xmlAttachmentRef"; //$NON-NLS-1$
-
- XmlAttachmentRef getXmlAttachmentRef();
-
- XmlAttachmentRef addXmlAttachmentRef();
-
- void removeXmlAttachmentRef();
-
-
- // ***** misc *****
-
- XsdFeature getXsdFeature();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java
deleted file mode 100644
index d223416f95..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Common interface for XmlElementMapping, XmlAttributeMapping, and XmlValueMapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlNodeMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** xml schema type *****
-
- String XML_SCHEMA_TYPE_PROPERTY = "xmlSchemaType"; //$NON-NLS-1$
-
- XmlSchemaType getXmlSchemaType();
-
- XmlSchemaType addXmlSchemaType();
-
- void removeXmlSchemaType();
-
-
- // ***** XmlList *****
-
- boolean isXmlList();
-
- String SPECIFIED_XML_LIST_PROPERTY = "specifiedXmlList"; //$NON-NLS-1$
-
- boolean isSpecifiedXmlList();
-
- void setSpecifiedXmlList(boolean newValue);
-
- String DEFAULT_XML_LIST_PROPERTY = "defaultXmlList"; //$NON-NLS-1$
-
- boolean isDefaultXmlList();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
deleted file mode 100644
index 2957f574d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlNs
- extends JavaContextNode {
-
-
- XmlNsAnnotation getResourceXmlNs();
-
-
- // ***** namespaceURI *****
-
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- String getNamespaceURI();
-
- void setNamespaceURI(String namespaceURI);
-
-
- // ***** prefix *****
-
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-
- String getPrefix();
-
- void setPrefix(String prefix);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java
deleted file mode 100644
index 25b8ebc374..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlNsForm {
-
- QUALIFIED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED
- ),
- UNQUALIFIED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED
- ),
- UNSET(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNSET
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm;
-
- XmlNsForm(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- if (javaNsForm == null) {
- throw new NullPointerException();
- }
- this.javaNsForm = javaNsForm;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm getJavaNsForm() {
- return this.javaNsForm;
- }
-
-
- // ********** static methods **********
-
- public static XmlNsForm fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- return (javaNsForm == null) ? null : fromJavaResourceModel_(javaNsForm);
- }
-
- private static XmlNsForm fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- for (XmlNsForm nsForm : XmlNsForm.values()) {
- if (nsForm.getJavaNsForm() == javaNsForm) {
- return nsForm;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm toJavaResourceModel(XmlNsForm nsForm) {
- return (nsForm == null) ? null : nsForm.getJavaNsForm();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java
deleted file mode 100644
index 8e8be55590..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB registry
- * (A class with an explicit @XmlRegistry annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRegistry
- extends JavaContextNode {
-
- // ***** element factory methods ******
-
- String ELEMENT_FACTORY_METHODS_COLLECTION = "elementFactoryMethods"; //$NON-NLS-1$
-
- Iterable<JaxbElementFactoryMethod> getElementFactoryMethods();
-
- int getElementFactoryMethodsSize();
-
-
- // ***** misc *****
-
- JaxbClass getJaxbClass();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
deleted file mode 100644
index 9c57969d97..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB xml root element.
- * (A class with an explicit @XmlRootElement annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRootElement
- extends JavaContextNode {
-
- JaxbTypeMapping getTypeMapping();
-
- JaxbQName getQName();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
deleted file mode 100644
index 02be8d7833..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchema
- extends JavaContextNode {
-
- JaxbPackageInfo getJaxbPackageInfo();
-
-
- // ***** namespace *****
-
- /**
- * Return the specified namespace or "" (default value)
- */
- String getNamespace();
-
- /**
- * Return the specified namespace, null if it is not specified
- */
- String getSpecifiedNamespace();
-
- /**
- * Set the namespace, null to unspecify
- */
- void setSpecifiedNamespace(String namespace);
-
- /**
- * String constant associated with changes to the specified namespace
- */
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the XmlSchema annotation location element
- */
- String getLocation();
- void setLocation(String location);
- String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
- String DEFAULT_LOCATION = "##generate"; //$NON-NLS-1$
-
-
- // **************** attribute form default ********************************
-
- /**
- * Return the specified attribute form default or XmlNsForm.UNSET (default value)
- */
- XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the specified attribute form default, null if it is not specified
- */
- XmlNsForm getSpecifiedAttributeFormDefault();
-
- /**
- * Set the attribute form default, null to unspecify
- */
- void setSpecifiedAttributeFormDefault(XmlNsForm attributeFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
-
-
- // **************** element form default ********************************
-
- /**
- * Return the specified element form default or XmlNsForm.UNSET (default value)
- */
- XmlNsForm getElementFormDefault();
-
- /**
- * Return the specified element form default, null if it is not specified
- */
- XmlNsForm getSpecifiedElementFormDefault();
-
- /**
- * Set the element form default, null to unspecify
- */
- void setSpecifiedElementFormDefault(XmlNsForm elementFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
-
-
- // ********** xml namespace prefixes **********
-
- ListIterable<XmlNs> getXmlNsPrefixes();
- int getXmlNsPrefixesSize();
- XmlNs addXmlNsPrefix(int index);
- void removeXmlNsPrefix(int index);
- void removeXmlNsPrefix(XmlNs xmlNsPrefix);
- void moveXmlNsPrefix(int targetIndex, int sourceIndex);
- String XML_NS_PREFIXES_LIST = "xmlNsPrefixes"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
deleted file mode 100644
index 55b5a60229..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.xsd.util.XSDUtil;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlSchemaType
- extends JavaContextNode {
-
- String DEFAULT_NAMESPACE = XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001;
-
- XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation();
-
- JaxbQName getQName();
-
-
- // ***** type *****
-
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the XmlSchemaType annotation 'type' element
- */
- String getType();
-
- void setType(String type);
-
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT"; //$NON-NLS-1$
-
- public String getFullyQualifiedType();
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java
deleted file mode 100644
index f291894fd8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Maintains a list of classes (class names here) to be added to the JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-
-public interface XmlSeeAlso
- extends JavaContextNode {
-
- // **************** value *************************************************
-
- public static final String CLASSES_LIST = "classes";
-
- ListIterable<String> getClasses();
-
- int getClassesSize();
-
- void addClass(int index, String clazz);
-
- void removeClass(int index);
-
- void moveClass(int targetIndex, int sourceIndex);
-
-
- // **************** misc **************************************************
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java
deleted file mode 100644
index e01c18e7fd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml value mapping (@XmlValue)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlValueMapping
- extends XmlNodeMapping {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java
deleted file mode 100644
index ff6fdc4ac3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface DefaultJavaAttributeMappingDefinition extends JavaAttributeMappingDefinition
-{
-
- /**
- * Return whether this mapping provider should be used for the given {@link JaxbPersistentAttribute}
- * in the default (ignoring all mapping annotations) case.
- */
- boolean isDefault(JaxbPersistentAttribute persistentAttribute);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java
deleted file mode 100644
index d427d8eb01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaAttributeMappingDefinition
-{
- /**
- * Return the attribute mapping's key.
- */
- String getKey();
-
- /**
- * Return the attribute mapping's Java annotation name.
- */
- String getAnnotationName();
-
- /**
- * Build a Java attribute mapping for the specified attribute. Use the specified
- * factory for creation so extenders can simply override the appropriate
- * creation method instead of building a provider for the same key.
- */
- JaxbAttributeMapping buildMapping(JaxbPersistentAttribute attribute, JaxbFactory factory);
-
- /**
- * Return all fully qualified annotation names that are supported with this mapping type.
- * This includes all possible annotations, not just the ones that currently exist on the attribute.
- */
- Iterable<String> getSupportingAnnotationNames();
-
- /**
- * Return whether this mapping provider should be used for the given {@link PersistentAttribute}
- * in the specified (observing all mapping annotations) case.
- */
- boolean isSpecified(JaxbPersistentAttribute persistentAttribute);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java
deleted file mode 100644
index b2859f03dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public interface JavaContextNode
- extends JaxbContextNode {
-
- // **************** content assist ****************************************
-
- /**
- * Return the Java code-completion proposals for the specified position in the source code.
- */
- Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot);
-
-
- // ******************** validation ****************************************
-
- /**
- * Adds to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- /**
- * Return the text range for highlighting errors for this object
- */
- TextRange getValidationTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
deleted file mode 100644
index 2bfd9edc6e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProject.Config;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.GenericContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.context.GenericPackage;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaClassMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumConstant;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaJaxbClass;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaJaxbEnum;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPackageInfo;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlNs;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlRootElement;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlSchema;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlTransientMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * Central class that allows extenders to easily replace implementations of
- * various Dali interfaces.
- */
-public abstract class AbstractJaxbFactory
- implements JaxbFactory {
-
- protected AbstractJaxbFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- public JaxbProject buildJaxbProject(Config config) {
- return new GenericJaxbProject(config);
- }
-
- public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel) {
- return new GenericJaxbFile(jaxbProject, file, contentType, resourceModel);
- }
-
-
- // ********** Non-resource-specific context nodes **********
-
- public JaxbContextRoot buildContextRoot(JaxbProject parent) {
- return new GenericContextRoot(parent);
- }
-
- public JaxbPackage buildPackage(JaxbContextRoot parent, String packageName) {
- return new GenericPackage(parent, packageName);
- }
-
-
- // ***** Java context nodes *****
-
- public JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage) {
- return new GenericJavaPackageInfo(parent, resourcePackage);
- }
-
- public XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent) {
- return new GenericJavaXmlSchema(parent);
- }
-
- public XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- return new GenericJavaXmlNs(parent, xmlNsAnnotation);
- }
-
- public JaxbClass buildJaxbClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- return new GenericJavaJaxbClass(parent, resourceType);
- }
-
- public JaxbEnum buildJaxbEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum) {
- return new GenericJavaJaxbEnum(parent, resourceEnum);
- }
-
- public JaxbClassMapping buildJaxbClassMapping(JaxbClass parent) {
- return new GenericJavaClassMapping(parent);
- }
-
- public JaxbEnumMapping buildJaxbEnumMapping(JaxbEnum parent) {
- return new GenericJavaEnumMapping(parent);
- }
-
- public XmlRegistry buildXmlRegistry(JaxbClass parent) {
- return new GenericJavaXmlRegistry(parent);
- }
-
- public JaxbElementFactoryMethod buildJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- return new GenericJavaElementFactoryMethod(parent, resourceMethod);
- }
-
- public XmlRootElement buildJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation xmlRootElementAnnotation) {
- return new GenericJavaXmlRootElement(parent, xmlRootElementAnnotation);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor) {
- return new GenericJavaPersistentAttribute(parent, accessor);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentField(JaxbClassMapping parent, JavaResourceField resourceField) {
- return GenericJavaPersistentAttribute.buildPersistentField(parent, resourceField);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentProperty(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return GenericJavaPersistentAttribute.buildPersistentProperty(parent, resourceGetter, resourceSetter);
- }
-
- public JaxbAttributeMapping buildJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaNullAttributeMapping(parent);
- }
-
- public JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlTransientMapping(parent);
- }
-
- public XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAnyAttributeMapping(parent);
- }
-
- public XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAnyElementMapping(parent);
- }
-
- public XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAttributeMapping(parent);
- }
-
- public XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementMapping(parent);
- }
-
- public XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementRefMapping(parent);
- }
-
- public XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementRefsMapping(parent);
- }
-
- public XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementsMapping(parent);
- }
-
- public XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlValueMapping(parent);
- }
-
- public JaxbEnumConstant buildJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant) {
- return new GenericJavaEnumConstant(parent, resourceEnumConstant);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
deleted file mode 100644
index 8357f5f173..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTModifiedDeclaration.Adapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.AspectChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-
-/**
- * Some common Dali behavior:<ul>
- * <li>containment hierarchy
- * <li>Eclipse adaptable
- * <li>update triggers
- * </ul>
- */
-public abstract class AbstractJaxbNode
- extends AbstractModel
- implements JaxbNode
-{
- private final JaxbNode parent;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJaxbNode(JaxbNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- protected void checkParent(JaxbNode p) {
- if (p == null) {
- if (this.requiresParent()) {
- throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
- }
- } else {
- if (this.forbidsParent()) {
- throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
- }
- }
- }
-
- protected boolean requiresParent() {
- return true;
- }
-
- protected boolean forbidsParent() {
- return ! this.requiresParent(); // assume 'parent' is not optional
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new AspectChangeSupport(this, this.buildChangeSupportListener());
- }
-
- protected AspectChangeSupport.Listener buildChangeSupportListener() {
- return new AspectChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJaxbNode.this.aspectChanged(aspectName);
- }
- };
- }
-
-
- // ********** IAdaptable implementation **********
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public Object getAdapter(Class adapter) {
- return PlatformTools.getAdapter(this, adapter);
- }
-
-
- // ********** JaxbNode implementation **********
-
- public JaxbNode getParent() {
- return this.parent;
- }
-
- public IResource getResource() {
- return this.parent.getResource();
- }
-
- public JaxbProject getJaxbProject() {
- return this.parent.getJaxbProject();
- }
-
-
- // ********** convenience methods **********
-
- protected JaxbPlatform getPlatform() {
- return this.getJaxbProject().getPlatform();
- }
-
-// protected JaxbPlatform.Version getJaxbPlatformVersion() {
-// return this.getJaxbPlatform().getJaxbPlatformVersion();
-// }
-
- protected JaxbFactory getFactory() {
- return this.getPlatform().getFactory();
- }
-
- protected JaxbFile getJaxbFile(IFile file) {
- return this.getJaxbProject().getJaxbFile(file);
- }
-
-
- // ********** CallbackChangeSupport.Listener support **********
-
- protected void aspectChanged(String aspectName) {
- if (this.aspectTriggersUpdate(aspectName)) {
-// String msg = Thread.currentThread() + " aspect change: " + this + ": " + aspectName;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- this.stateChanged();
- }
- }
-
- private boolean aspectTriggersUpdate(String aspectName) {
- return ! this.aspectDoesNotTriggerUpdate(aspectName);
- }
-
- protected boolean aspectDoesNotTriggerUpdate(String aspectName) {
- // ignore state changes so we don't get a stack overflow :-)
- // (and we don't use state changes except here)
- return (aspectName == null) ||
- this.nonUpdateAspectNames().contains(aspectName);
- }
-
- protected final Set<String> nonUpdateAspectNames() {
- synchronized (nonUpdateAspectNameSets) {
- HashSet<String> nonUpdateAspectNames = nonUpdateAspectNameSets.get(this.getClass());
- if (nonUpdateAspectNames == null) {
- nonUpdateAspectNames = new HashSet<String>();
- this.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNameSets.put(this.getClass(), nonUpdateAspectNames);
- }
- return nonUpdateAspectNames;
- }
- }
-
- private static final HashMap<Class<? extends AbstractJaxbNode>, HashSet<String>> nonUpdateAspectNameSets = new HashMap<Class<? extends AbstractJaxbNode>, HashSet<String>>();
-
- protected void addNonUpdateAspectNamesTo(@SuppressWarnings("unused") Set<String> nonUpdateAspectNames) {
- // when you override this method, don't forget to include:
- // super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- }
-
- public void stateChanged() {
- this.fireStateChanged();
- if (this.parent != null) {
- this.parent.stateChanged();
- }
- }
-
-
- /**
- * Adapter used to synchronize a context collection container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class CollectionContainer<C, R> {
-
- protected final Vector<C> contextElements = new Vector<C>();
-
- protected CollectionContainer() {
- super();
- }
-
- /**
- * Return the container's current set of resource elements.
- * These are what the context elements will be synchronized to.
- */
- protected abstract Iterable<R> getResourceElements();
-
- /**
- * Return the resource element corresponding to the specified context
- * element.
- */
- protected abstract R getResourceElement(C contextElement);
-
- /**
- * Build and return a context element for the given resource element
- */
- protected abstract C buildContextElement(R resourceElement);
-
- /**
- * Return the property name for event notification when the collection is changed.
- */
- protected abstract String getContextElementsPropertyName();
-
- /**
- * clients needs to call initialize if necessary
- */
- public void initialize() {
- for (R resourceElement : this.getResourceElements()) {
- this.contextElements.add(this.buildContextElement(resourceElement));
- }
- }
-
- /**
- * Return an Iterable of the context elements
- */
- public Iterable<C> getContextElements() {
- return new LiveCloneIterable<C>(this.contextElements);
- }
-
- /**
- * Return the size of the context elements collection
- */
- public int getContextElementsSize() {
- return this.contextElements.size();
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- public C addContextElement(int index, R resourceElement) {
- return this.addContextElement_(index, this.buildContextElement(resourceElement));
- }
-
- /**
- * Add the specified context element to the collection ignoring
- * the specified index as we only have a collection
- */
- protected C addContextElement_(@SuppressWarnings("unused") int index, C contextElement) {
- AbstractJaxbNode.this.addItemToCollection(contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Remove the specified context element from the container.
- */
- public void removeContextElement(C element) {
- AbstractJaxbNode.this.removeItemFromCollection(element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- @SuppressWarnings("unused")
- protected void moveContextElement(int index, C element) {
- //no-op, not a list
- }
- }
-
- /**
- * Adapter used to synchronize a context collection container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ContextCollectionContainer<C extends JaxbContextNode, R> extends CollectionContainer<C, R> {
-
- protected ContextCollectionContainer() {
- super();
- }
-
- /**
- * Using the specified adapter, synchronize a context container with its
- * corresponding resource container: moving, removing, and adding elements
- * as necessary.
- * <p>
- * We can do this because:<ul>
- * <li>the XML translators will <em>move</em> the EMF elements when
- * appropriate (as opposed to simply rebuilding them in place).
- * <li>the Java resource model will re-use existing annotations when
- * appropriate (as opposed to simply rebuilding them in place).
- * </ul>
- */
- public void synchronizeWithResourceModel() {
- sync(true); // true = sync
- }
-
- /**
- * @see #synchronizeWithResourceModel(Adapter)
- */
- public void update() {
- sync(false); // false = update
- }
-
- /**
- * The specified <code>sync</code> flag controls whether any surviving
- * context nodes are either <em>synchronized</em> (<code>true</code>) or
- * <em>updated</em> (<code>false</code>).
- */
- protected void sync(boolean sync) {
- HashSet<C> contextElements = CollectionTools.set(this.getContextElements());
- int resourceIndex = 0;
-
- for (R resourceElement : this.getResourceElements()) {
- boolean match = false;
- for (Iterator<C> stream = contextElements.iterator(); stream.hasNext(); ) {
- C contextElement = stream.next();
- if (Tools.valuesAreEqual(this.getResourceElement(contextElement), resourceElement)) {
- // we don't know the source index because the element has been moved by previously moved elements
- this.moveContextElement(resourceIndex, contextElement);
- stream.remove();
- if (sync) {
- contextElement.synchronizeWithResourceModel();
- } else {
- contextElement.update();
- }
- match = true;
- break;
- }
- }
- if ( ! match) {
- // added elements are sync'ed during construction or will be
- // updated during the next "update" (which is triggered by
- // their addition to the model)
- this.addContextElement(resourceIndex, resourceElement);
- }
- resourceIndex++;
- }
- // remove any leftover context elements
- for (C contextElement : contextElements) {
- this.removeContextElement(contextElement);
- }
- }
- }
-
- /**
- * Adapter used to synchronize a context list container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ListContainer<C, R>
- extends CollectionContainer<C, R> {
-
- protected ListContainer() {
- super();
- }
-
- @Override
- public ListIterable<C> getContextElements() {
- return new LiveCloneListIterable<C>(this.contextElements);
- }
-
- @Override
- protected abstract ListIterable<R> getResourceElements();
-
- /**
- * Return the index of the specified context element.
- */
- public int indexOfContextElement(C contextElement) {
- return this.contextElements.indexOf(contextElement);
- }
-
- public C getContextElement(int index) {
- return this.contextElements.elementAt(index);
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- @Override
- protected C addContextElement_(int index, C contextElement) {
- AbstractJaxbNode.this.addItemToList(index, contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Move the context element at the specified target index to the
- * specified source index.
- */
- public void moveContextElement(int targetIndex, int sourceIndex) {
- this.moveContextElement(targetIndex, this.contextElements.get(sourceIndex));
- }
-
- /**
- * Move the specified context element to the specified index.
- */
- @Override
- public void moveContextElement(int index, C element) {
- AbstractJaxbNode.this.moveItemInList(index, element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- /**
- * Remove the context element at the specified index from the container.
- */
- public void removeContextElement(int index) {
- AbstractJaxbNode.this.removeItemFromList(index, this.contextElements, this.getContextElementsPropertyName());
- }
-
- public void synchronizeWithResourceModel() {
- ListIterable<R> resourceElements = getResourceElements();
-
- int index = 0;
- for (R resourceElement : resourceElements) {
- if (this.getContextElementsSize() > index) {
- if (this.getContextElement(index) != resourceElement) {
- this.addContextElement(index, resourceElement);
- }
- }
- else {
- this.addContextElement(index, resourceElement);
- }
- index++;
- }
-
- for ( ; index < this.getContextElementsSize(); ) {
- this.removeContextElement(index);
- }
- }
- }
-
- /**
- * Adapter used to synchronize a context list container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ContextListContainer<C extends JaxbContextNode, R>
- extends ContextCollectionContainer<C, R> {
-
- protected ContextListContainer() {
- super();
- }
-
- @Override
- public ListIterable<C> getContextElements() {
- return new LiveCloneListIterable<C>(this.contextElements);
- }
-
- @Override
- protected abstract ListIterable<R> getResourceElements();
-
- /**
- * Return the index of the specified context element.
- */
- public int indexOfContextElement(C contextElement) {
- return this.contextElements.indexOf(contextElement);
- }
-
- public C getContextElement(int index) {
- return this.contextElements.elementAt(index);
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- @Override
- protected C addContextElement_(int index, C contextElement) {
- AbstractJaxbNode.this.addItemToList(index, contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Move the context element at the specified target index to the
- * specified source index.
- */
- public void moveContextElement(int targetIndex, int sourceIndex) {
- this.moveContextElement(targetIndex, this.contextElements.get(sourceIndex));
- }
-
- /**
- * Move the specified context element to the specified index.
- */
- @Override
- public void moveContextElement(int index, C element) {
- AbstractJaxbNode.this.moveItemInList(index, element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- /**
- * Remove the context element at the specified index from the container.
- */
- public void removeContextElement(int index) {
- AbstractJaxbNode.this.removeItemFromList(index, this.contextElements, this.getContextElementsPropertyName());
- }
-
- @Override
- public void removeContextElement(C contextElement) {
- AbstractJaxbNode.this.removeItemFromList(contextElement, this.contextElements, this.getContextElementsPropertyName());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java
deleted file mode 100644
index dd75e3a83e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-/**
- * All the state in the JAXB platform definition should be "static"
- * (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractJaxbPlatformDefinition
- implements JaxbPlatformDefinition {
-
- private Map<String, String> javaToSchemaTypes;
-
- private AnnotationDefinition[] annotationDefinitions;
-
- private NestableAnnotationDefinition[] nestableAnnotationDefinitions;
-
- private JaxbResourceModelProvider[] resourceModelProviders;
-
- private ArrayList<DefaultJavaAttributeMappingDefinition> defaultJavaAttributeMappingDefinitions;
-
- private ArrayList<JavaAttributeMappingDefinition> specifiedJavaAttributeMappingDefinitions;
-
-// private ResourceDefinition[] resourceDefinitions;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractJaxbPlatformDefinition() {
- super();
- }
-
-
- // ***** platform-y things *****
-
- public String getSchemaTypeMapping(String javaTypeName) {
- if (this.javaToSchemaTypes == null) {
- this.javaToSchemaTypes = new HashMap<String, String>();
- this.javaToSchemaTypes.putAll(buildJavaToSchemaTypes());
- }
- return this.javaToSchemaTypes.get(javaTypeName);
- }
-
- protected Map<String, String> buildJavaToSchemaTypes() {
- return Collections.EMPTY_MAP;
- }
-
-
- // ********** annotation definitions **********
-
- public AnnotationDefinition[] getAnnotationDefinitions() {
- if (this.annotationDefinitions == null) {
- this.annotationDefinitions = this.buildAnnotationDefinitions();
- }
- return this.annotationDefinitions;
- }
-
- protected abstract AnnotationDefinition[] buildAnnotationDefinitions();
-
-
- // ********** nestable annotation definitions **********
-
- public NestableAnnotationDefinition[] getNestableAnnotationDefinitions() {
- if (this.nestableAnnotationDefinitions == null) {
- this.nestableAnnotationDefinitions = this.buildNestableAnnotationDefinitions();
- }
- return this.nestableAnnotationDefinitions;
- }
-
- protected abstract NestableAnnotationDefinition[] buildNestableAnnotationDefinitions();
-
-
- // ********** resource models **********
-
- public ListIterable<JaxbResourceModelProvider> getResourceModelProviders() {
- return new ArrayListIterable<JaxbResourceModelProvider>(getResourceModelProviders_());
- }
-
- protected synchronized JaxbResourceModelProvider[] getResourceModelProviders_() {
- if (this.resourceModelProviders == null) {
- this.resourceModelProviders = this.buildResourceModelProviders();
- }
- return this.resourceModelProviders;
- }
-
- protected abstract JaxbResourceModelProvider[] buildResourceModelProviders();
-
-
- // ********** Java attribute mappings **********
-
- public synchronized Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions() {
- if (this.defaultJavaAttributeMappingDefinitions == null) {
- this.defaultJavaAttributeMappingDefinitions = this.buildDefaultJavaAttributeMappingDefinitions();
- }
- return this.defaultJavaAttributeMappingDefinitions;
- }
-
- protected ArrayList<DefaultJavaAttributeMappingDefinition> buildDefaultJavaAttributeMappingDefinitions() {
- ArrayList<DefaultJavaAttributeMappingDefinition> definitions = new ArrayList<DefaultJavaAttributeMappingDefinition>();
- this.addDefaultJavaAttributeMappingDefinitionsTo(definitions);
- return definitions;
- }
-
- /**
- * To the specified list, add mapping definitions to use for analyzing the
- * default mapping of an attribute. The order is important,
- * as once a mapping definition tests positive for an attribute,
- * all following mapping definitions are ignored.
- */
- protected abstract void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions);
-
- public synchronized Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions() {
- if (this.specifiedJavaAttributeMappingDefinitions == null) {
- this.specifiedJavaAttributeMappingDefinitions = this.buildSpecifiedJavaAttributeMappingDefinitions();
- }
- return this.specifiedJavaAttributeMappingDefinitions;
- }
-
- protected ArrayList<JavaAttributeMappingDefinition> buildSpecifiedJavaAttributeMappingDefinitions() {
- ArrayList<JavaAttributeMappingDefinition> definitions = new ArrayList<JavaAttributeMappingDefinition>();
- this.addSpecifiedJavaAttributeMappingDefinitionsTo(definitions);
- return definitions;
- }
-
- /**
- * To the specified list, add mapping definitions to use for analyzing the
- * specified mapping of an attribute given all annotations on it. The order
- * is important, as once a mapping definition tests positive for an
- * attribute, all following mapping definitions are ignored.
- */
- protected abstract void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions);
-
-
-// // ********** Mapping Files **********
-//
-// public ListIterator<ResourceDefinition> resourceDefinitions() {
-// return new ArrayListIterator<ResourceDefinition>(getResourceDefinitions());
-// }
-//
-// protected synchronized ResourceDefinition[] getResourceDefinitions() {
-// if (this.resourceDefinitions == null) {
-// this.resourceDefinitions = this.buildResourceDefinitions();
-// }
-// return this.resourceDefinitions;
-// }
-//
-// protected abstract ResourceDefinition[] buildResourceDefinitions();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
deleted file mode 100644
index 35af48af0d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
+++ /dev/null
@@ -1,1660 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageDeclaration;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.command.ExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.command.ThreadLocalExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.synchronizers.CallbackSynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformImpl;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * JAXB project. Holds all the JAXB stuff.
- *
- * The JAXB platform provides the hooks for vendor-specific stuff.
- *
- * The JAXB files are the "resource" model (i.e. objects that correspond directly
- * to Eclipse resources; e.g. Java source code files, XML files, JAR files).
- *
- * The root context node is the "context" model (i.e. objects that attempt to
- * model the JAXB spec, using the "resource" model as an adapter to the Eclipse
- * resources).
- */
-public abstract class AbstractJaxbProject
- extends AbstractJaxbNode
- implements JaxbProject {
-
- /**
- * The Eclipse project corresponding to the JAXB project.
- */
- protected final IProject project;
-
- /**
- * The vendor-specific JAXB platform that builds the JAXB project
- * and all its contents.
- */
- protected final JaxbPlatform jaxbPlatform;
-
- /**
- * The library of schemas associated with this project
- */
- protected final SchemaLibraryImpl schemaLibrary;
-
- /**
- * The JAXB files associated with the JAXB project:
- * java
- * jaxb.index
- * platform-specific files
- */
- protected final Vector<JaxbFile> jaxbFiles = new Vector<JaxbFile>();
-
-// /**
-// * The "external" Java resource compilation units (source). Populated upon demand.
-// */
-// protected final Vector<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits = new Vector<JavaResourceCompilationUnit>();
-//
-// /**
-// * The "external" Java resource persistent types (binary). Populated upon demand.
-// */
-// protected final JavaResourcePersistentTypeCache externalJavaResourcePersistentTypeCache;
-
- /**
- * Resource models notify this listener when they change. A project update
- * should occur any time a resource model changes.
- */
- protected final JptResourceModelListener resourceModelListener;
-
- /**
- * The root of the model representing the collated resources associated with
- * the JAXB project.
- */
- protected final JaxbContextRoot contextRoot;
-
- /**
- * A pluggable synchronizer that keeps the JAXB
- * project's context model synchronized with its resource model, either
- * synchronously or asynchronously (or not at all). A synchronous synchronizer
- * is the default. For performance reasons, a UI should
- * immediately change this to an asynchronous synchronizer. A synchronous
- * synchronizer can be used when the project is being manipulated by a "batch"
- * (or non-UI) client (e.g. when testing "synchronization"). A null updater
- * can used during tests that do not care whether "synchronization" occur.
- * Clients will need to explicitly configure the synchronizer if they require
- * an asynchronous synchronizer.
- */
- protected volatile Synchronizer contextModelSynchronizer;
- protected volatile boolean synchronizingContextModel = false;
-
- /**
- * A pluggable synchronizer that "updates" the JAXB project, either
- * synchronously or asynchronously (or not at all). A synchronous updater
- * is the default, allowing a newly-constructed JAXB project to be "updated"
- * upon return from the constructor. For performance reasons, a UI should
- * immediately change this to an asynchronous updater. A synchronous
- * updater can be used when the project is being manipulated by a "batch"
- * (or non-UI) client (e.g. when testing the "update" behavior). A null
- * updater can used during tests that do not care whether "synchronization"
- * occur.
- * Clients will need to explicitly configure the updater if they require
- * an asynchronous updater.
- */
- protected volatile CallbackSynchronizer updateSynchronizer;
- protected final CallbackSynchronizer.Listener updateSynchronizerListener;
-
- /**
- * Support for modifying documents shared with the UI.
- */
- protected final ThreadLocalExtendedCommandExecutor modifySharedDocumentCommandExecutor;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJaxbProject(JaxbProject.Config config) {
- super(null); // JPA project is the root of the containment tree
- if ((config.getProject() == null) || (config.getPlatformDefinition() == null)) {
- throw new NullPointerException();
- }
- this.project = config.getProject();
- this.jaxbPlatform = new JaxbPlatformImpl(config.getPlatformDefinition());
-
- this.schemaLibrary = new SchemaLibraryImpl(this);
-
- this.modifySharedDocumentCommandExecutor = this.buildModifySharedDocumentCommandExecutor();
-
- this.resourceModelListener = this.buildResourceModelListener();
- // build the JPA files corresponding to the Eclipse project's files
- InitialResourceProxyVisitor visitor = this.buildInitialResourceProxyVisitor();
- visitor.visitProject(this.project);
-
-// this.externalJavaResourcePersistentTypeCache = this.buildExternalJavaResourcePersistentTypeCache();
-
- this.contextRoot = this.buildContextRoot();
-
- // there *shouldn't* be any changes to the resource model...
- this.setContextModelSynchronizer_(this.buildSynchronousContextModelSynchronizer());
-
- this.updateSynchronizerListener = this.buildUpdateSynchronizerListener();
- // "update" the project before returning
- this.setUpdateSynchronizer_(this.buildSynchronousUpdateSynchronizer());
-
-// // start listening to this cache once the context model has been built
-// // and all the external types are faulted in
-// this.externalJavaResourcePersistentTypeCache.addResourceModelListener(this.resourceModelListener);
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public IResource getResource() {
- return this.project;
- }
-
- protected ThreadLocalExtendedCommandExecutor buildModifySharedDocumentCommandExecutor() {
- return new ThreadLocalExtendedCommandExecutor();
- }
-
- protected InitialResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new InitialResourceProxyVisitor();
- }
-//
-// protected JavaResourcePersistentTypeCache buildExternalJavaResourcePersistentTypeCache() {
-// return new BinaryPersistentTypeCache(this.jpaPlatform.getAnnotationProvider());
-// }
-
- protected JaxbContextRoot buildContextRoot() {
- return this.getFactory().buildContextRoot(this);
- }
-
- // ***** inner class
- protected class InitialResourceProxyVisitor implements IResourceProxyVisitor {
- protected InitialResourceProxyVisitor() {
- super();
- }
- protected void visitProject(IProject p) {
- try {
- p.accept(this, IResource.NONE);
- } catch (CoreException ex) {
- // shouldn't happen - we don't throw any CoreExceptions
- throw new RuntimeException(ex);
- }
- }
- // add a JPA file for every [appropriate] file encountered by the visitor
- public boolean visit(IResourceProxy resource) {
- switch (resource.getType()) {
- case IResource.ROOT : // shouldn't happen
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- AbstractJaxbProject.this.addJaxbFile_((IFile) resource.requestResource());
- return false; // no children
- default :
- return false; // no children
- }
- }
- }
-
-
-// // ********** miscellaneous **********
-//
-// /**
-// * Ignore changes to this collection. Adds can be ignored since they are triggered
-// * by requests that will, themselves, trigger updates (typically during the
-// * update of an object that calls a setter with the newly-created resource
-// * type). Deletes will be accompanied by manual updates.
-// */
-// @Override
-// protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
-// super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
-// nonUpdateAspectNames.add(EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// }
-
-
- // ********** general queries **********
-
- @Override
- public JaxbProject getJaxbProject() {
- return this;
- }
-
- public String getName() {
- return this.project.getName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- public IProject getProject() {
- return this.project;
- }
-
- public IJavaProject getJavaProject() {
- return JavaCore.create(this.project);
- }
-
- @Override
- public JaxbPlatform getPlatform() {
- return this.jaxbPlatform;
- }
-
- public SchemaLibrary getSchemaLibrary() {
- return this.schemaLibrary;
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceCompilationUnit> getCombinedJavaResourceCompilationUnits() {
- return this.getInternalJavaResourceCompilationUnits();
-// return new CompositeIterable<JavaResourceCompilationUnit>(
-// this.getInternalJavaResourceCompilationUnits(),
-// this.getExternalJavaResourceCompilationUnits()
-// );
- }
-
-
- // ********** JAXB files **********
-
- public Iterable<JaxbFile> getJaxbFiles() {
- return new LiveCloneIterable<JaxbFile>(this.jaxbFiles); // read-only
- }
-
- public int getJaxbFilesSize() {
- return this.jaxbFiles.size();
- }
-
- protected Iterable<JaxbFile> getJaxbFiles(final IContentType contentType) {
- return new FilteringIterable<JaxbFile>(this.getJaxbFiles()) {
- @Override
- protected boolean accept(JaxbFile jaxbFile) {
- return jaxbFile.getContentType().isKindOf(contentType);
- }
- };
- }
-
- @Override
- public JaxbFile getJaxbFile(IFile file) {
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- if (jaxbFile.getFile().equals(file)) {
- return jaxbFile;
- }
- }
- return null;
- }
-
- /**
- * Add a JAXB file for the specified file, if appropriate.
- * Return true if a JAXB File was created and added, false otherwise
- */
- protected boolean addJaxbFile(IFile file) {
- JaxbFile jaxbFile = this.addJaxbFile_(file);
- if (jaxbFile != null) {
- this.fireItemAdded(JAXB_FILES_COLLECTION, jaxbFile);
- return true;
- }
- return false;
- }
-
- /**
- * Add a JAXB file for the specified file, if appropriate, without firing
- * an event; useful during construction.
- * Return the new JAXB file, null if it was not created.
- */
- protected JaxbFile addJaxbFile_(IFile file) {
- if (isJavaFile(file)) {
- if (! getJavaProject().isOnClasspath(file)) {
- // a java (.jar or .java) file must be on the Java classpath
- return null;
- }
- }
- else if (! fileResourceLocationIsValid(file)) {
- return null;
- }
-
- JaxbFile jaxbFile = null;
- try {
- jaxbFile = this.getPlatform().buildJaxbFile(this, file);
- }
- catch (Exception e) {
- //log any developer exceptions and don't build a JaxbFile rather
- //than completely failing to build the JaxbProject
- JptJaxbCorePlugin.log(e);
- }
- if (jaxbFile == null) {
- return null;
- }
- jaxbFile.getResourceModel().addResourceModelListener(this.resourceModelListener);
- this.jaxbFiles.add(jaxbFile);
- return jaxbFile;
- }
-
- /* file is .java or .jar */
- protected boolean isJavaFile(IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return contentType != null
- && (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)
- || contentType.isKindOf(JptCommonCorePlugin.JAR_CONTENT_TYPE));
- }
-
- /* (non-java resource) file is in acceptable resource location */
- protected boolean fileResourceLocationIsValid(IFile file) {
- return this.getProjectResourceLocator().resourceLocationIsValid(file.getParent());
- }
-
- protected ProjectResourceLocator getProjectResourceLocator() {
- return (ProjectResourceLocator) this.project.getAdapter(ProjectResourceLocator.class);
- }
-
- /**
- * Remove the JAXB file corresponding to the specified IFile, if it exists.
- * Return true if a JAXB File was removed, false otherwise
- */
- protected boolean removeJaxbFile(IFile file) {
- JaxbFile jaxbFile = this.getJaxbFile(file);
- if (jaxbFile != null) { // a JpaFile is not added for every IFile
- this.removeJaxbFile(jaxbFile);
- return true;
- }
- return false;
- }
-
- /**
- * Stop listening to the JAXB file and remove it.
- */
- protected void removeJaxbFile(JaxbFile jaxbFile) {
- jaxbFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- if ( ! this.removeItemFromCollection(jaxbFile, this.jaxbFiles, JAXB_FILES_COLLECTION)) {
- throw new IllegalArgumentException(jaxbFile.toString());
- }
- }
-
-
-// // ********** external Java resource persistent types (source or binary) **********
-//
-// protected JavaResourcePersistentType buildPersistableExternalJavaResourcePersistentType(String typeName) {
-// IType jdtType = this.findType(typeName);
-// return (jdtType == null) ? null : this.buildPersistableExternalJavaResourcePersistentType(jdtType);
-// }
-//
-// protected IType findType(String typeName) {
-// try {
-// return this.getJavaProject().findType(typeName);
-// } catch (JavaModelException ex) {
-// return null; // ignore exception?
-// }
-// }
-//
-// protected JavaResourcePersistentType buildPersistableExternalJavaResourcePersistentType(IType jdtType) {
-// JavaResourcePersistentType jrpt = this.buildExternalJavaResourcePersistentType(jdtType);
-// return ((jrpt != null) && jrpt.isPersistable()) ? jrpt : null;
-// }
-//
-// protected JavaResourcePersistentType buildExternalJavaResourcePersistentType(IType jdtType) {
-// return jdtType.isBinary() ?
-// this.buildBinaryExternalJavaResourcePersistentType(jdtType) :
-// this.buildSourceExternalJavaResourcePersistentType(jdtType);
-// }
-//
-// protected JavaResourcePersistentType buildBinaryExternalJavaResourcePersistentType(IType jdtType) {
-// return this.externalJavaResourcePersistentTypeCache.addPersistentType(jdtType);
-// }
-//
-// protected JavaResourcePersistentType buildSourceExternalJavaResourcePersistentType(IType jdtType) {
-// JavaResourceCompilationUnit jrcu = this.getExternalJavaResourceCompilationUnit(jdtType.getCompilationUnit());
-// String jdtTypeName = jdtType.getFullyQualifiedName('.'); // JDT member type names use '$'
-// for (Iterator<JavaResourcePersistentType> stream = jrcu.persistentTypes(); stream.hasNext(); ) {
-// JavaResourcePersistentType jrpt = stream.next();
-// if (jrpt.getQualifiedName().equals(jdtTypeName)) {
-// return jrpt;
-// }
-// }
-// // we can get here if the project JRE is removed;
-// // see SourceCompilationUnit#getPrimaryType(CompilationUnit)
-// // bug 225332
-// return null;
-// }
-//
-//
-// // ********** external Java resource persistent types (binary) **********
-//
-// public JavaResourcePersistentTypeCache getExternalJavaResourcePersistentTypeCache() {
-// return this.externalJavaResourcePersistentTypeCache;
-// }
-//
-//
-// // ********** external Java resource compilation units (source) **********
-//
-// public Iterator<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits() {
-// return this.getExternalJavaResourceCompilationUnits().iterator();
-// }
-//
-// protected Iterable<JavaResourceCompilationUnit> getExternalJavaResourceCompilationUnits() {
-// return new LiveCloneIterable<JavaResourceCompilationUnit>(this.externalJavaResourceCompilationUnits); // read-only
-// }
-//
-// public int externalJavaResourceCompilationUnitsSize() {
-// return this.externalJavaResourceCompilationUnits.size();
-// }
-//
-// /**
-// * Return the resource model compilation unit corresponding to the specified
-// * JDT compilation unit. If it does not exist, build it.
-// */
-// protected JavaResourceCompilationUnit getExternalJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// if (jrcu.getCompilationUnit().equals(jdtCompilationUnit)) {
-// // we will get here if the JRCU could not build its persistent type...
-// return jrcu;
-// }
-// }
-// return this.addExternalJavaResourceCompilationUnit(jdtCompilationUnit);
-// }
-//
-// /**
-// * Add an external Java resource compilation unit.
-// */
-// protected JavaResourceCompilationUnit addExternalJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// JavaResourceCompilationUnit jrcu = this.buildJavaResourceCompilationUnit(jdtCompilationUnit);
-// this.addItemToCollection(jrcu, this.externalJavaResourceCompilationUnits, EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// jrcu.addResourceModelListener(this.resourceModelListener);
-// return jrcu;
-// }
-//
-// protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// return new SourceTypeCompilationUnit(
-// jdtCompilationUnit,
-// this.jpaPlatform.getAnnotationProvider(),
-// this.jpaPlatform.getAnnotationEditFormatter(),
-// this.modifySharedDocumentCommandExecutor
-// );
-// }
-//
-// protected boolean removeExternalJavaResourceCompilationUnit(IFile file) {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// if (jrcu.getFile().equals(file)) {
-// this.removeExternalJavaResourceCompilationUnit(jrcu);
-// return true;
-// }
-// }
-// return false;
-// }
-//
-// protected void removeExternalJavaResourceCompilationUnit(JavaResourceCompilationUnit jrcu) {
-// jrcu.removeResourceModelListener(this.resourceModelListener);
-// this.removeItemFromCollection(jrcu, this.externalJavaResourceCompilationUnits, EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// }
-
-
- // ********** context model **********
-
- public JaxbContextRoot getContextRoot() {
- return this.contextRoot;
- }
-
- public Iterable<? extends JavaContextNode> getPrimaryJavaNodes(ICompilationUnit cu) {
- IFile file = getCorrespondingResource(cu);
- if (file == null) {
- return EmptyIterable.instance();
- }
-
- IContentType contentType = PlatformTools.getContentType(file);
- if (contentType == null) {
- return EmptyIterable.instance();
- }
-
- if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- try {
- return new FilteringIterable<JaxbPackageInfo>(
- new TransformationIterable<IPackageDeclaration, JaxbPackageInfo>(
- new ArrayIterable<IPackageDeclaration>(cu.getPackageDeclarations())) {
- @Override
- protected JaxbPackageInfo transform(IPackageDeclaration o) {
- JaxbPackage jaxbPackage = getContextRoot().getPackage(o.getElementName());
- return (jaxbPackage != null) ? jaxbPackage.getPackageInfo() : null;
- }
- },
- NotNullFilter.<JaxbPackageInfo>instance());
- }
- catch (JavaModelException jme) {
- return EmptyIterable.instance();
- }
- }
- else if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- try {
- return new FilteringIterable<JaxbType>(
- new TransformationIterable<IType, JaxbType>(
- new ArrayIterable<IType>(cu.getAllTypes())) {
- @Override
- protected JaxbType transform(IType o) {
- JaxbType jaxbType = getContextRoot().getType(o.getFullyQualifiedName('.'));
- return jaxbType;
- }
- },
- NotNullFilter.<JaxbType>instance());
- }
- catch (JavaModelException jme) {
- return EmptyIterable.instance();
- }
- }
-
- return EmptyIterable.instance();
- }
-
- private IFile getCorrespondingResource(ICompilationUnit cu) {
- try {
- return (IFile) cu.getCorrespondingResource();
- }
- catch (JavaModelException ex) {
- JptJaxbCorePlugin.log(ex);
- return null;
- }
- }
-
-
-// // ********** utility **********
-//
-// public IFile getPlatformFile(IPath runtimePath) {
-// return JptCorePlugin.getPlatformFile(this.project, runtimePath);
-// }
-
-
-//
-// /**
-// * If the specified file exists, is significant to the JPA project, and its
-// * content is a "kind of" the specified content type, return the JPA
-// * resource model corresponding to the file; otherwise, return null.
-// */
-// protected JpaResourceModel getResourceModel(IPath runtimePath, IContentType contentType) {
-// IFile file = this.getPlatformFile(runtimePath);
-// return file.exists() ? this.getResourceModel(file, contentType) : null;
-// }
-//
-// /**
-// * If the specified file is significant to the JPA project and its content
-// * is a "kind of" the specified content type, return the JPA resource model
-// * corresponding to the file; otherwise, return null.
-// */
-// protected JpaResourceModel getResourceModel(IFile file, IContentType contentType) {
-// JpaFile jpaFile = this.getJpaFile(file);
-// return (jpaFile == null) ? null : jpaFile.getResourceModel(contentType);
-// }
-
-
- // ********** annotated Java source classes **********
-
- public Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.getInternalJavaSourceResourceTypeSets());
- }
-
- public Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes() {
- return new FilteringIterable<JavaResourceAbstractType>(getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType type) {
- return type.isAnnotated();
- }
- };
- }
-
-// public Iterable<String> getAnnotatedJavaSourceClassNames() {
-// return new TransformationIterable<JavaResourceType, String>(this.getInternalAnnotatedSourceJavaResourceTypes()) {
-// @Override
-// protected String transform(JavaResourceType type) {
-// return type.getQualifiedName();
-// }
-// };
-// }
-
- /*
- * Return the sets of {@link JavaResourceType}s that are represented by java source within this project
- */
- protected Iterable<Iterable<JavaResourceAbstractType>> getInternalJavaSourceResourceTypeSets() {
- return new TransformationIterable<JavaResourceCompilationUnit, Iterable<JavaResourceAbstractType>>(
- this.getInternalJavaResourceCompilationUnits()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourceCompilationUnit compilationUnit) {
- return compilationUnit.getTypes();
- }
- };
- }
-
- protected Iterable<JavaResourceCompilationUnit> getInternalJavaResourceCompilationUnits() {
- return new TransformationIterable<JaxbFile, JavaResourceCompilationUnit>(this.getJavaSourceJaxbFiles()) {
- @Override
- protected JavaResourceCompilationUnit transform(JaxbFile jaxbFile) {
- return (JavaResourceCompilationUnit) jaxbFile.getResourceModel();
- }
- };
- }
-
- /**
- * return JAXB files with Java source "content"
- */
- protected Iterable<JaxbFile> getJavaSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
-
- // ********** Java resource package look-up **********
-
- public Iterable<JavaResourcePackage> getJavaResourcePackages(){
- return new FilteringIterable<JavaResourcePackage>(
- new TransformationIterable<JaxbFile, JavaResourcePackage>(this.getPackageInfoSourceJaxbFiles()) {
- @Override
- protected JavaResourcePackage transform(JaxbFile jaxbFile) {
- return ((JavaResourcePackageInfoCompilationUnit) jaxbFile.getResourceModel()).getPackage();
- }
- }) {
-
- @Override
- protected boolean accept(JavaResourcePackage resourcePackage) {
- return resourcePackage != null;
- }
- };
- }
-
- public JavaResourcePackage getJavaResourcePackage(String packageName) {
- for (JavaResourcePackage jrp : this.getJavaResourcePackages()) {
- if (jrp.getName().equals(packageName)) {
- return jrp;
- }
- }
- return null;
- }
-
- public Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages() {
- return new FilteringIterable<JavaResourcePackage>(this.getJavaResourcePackages()) {
- @Override
- protected boolean accept(JavaResourcePackage resourcePackage) {
- return resourcePackage.isAnnotated(); // i.e. the package has a valid package annotation
- }
- };
- }
-
- public JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName) {
- JavaResourcePackage jrp = getJavaResourcePackage(packageName);
- return (jrp != null && jrp.isAnnotated()) ? jrp : null;
- }
-
- /**
- * return JPA files with package-info source "content"
- */
- protected Iterable<JaxbFile> getPackageInfoSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
- }
-
-
- // ********** Java resource type look-up **********
-
-
- public JavaResourceAbstractType getJavaResourceType(String typeName) {
- for (JavaResourceAbstractType type : this.getJavaResourceTypes()) {
- if (type.getQualifiedName().equals(typeName)) {
- return type;
- }
- }
- return null;
-// // if we don't have a type already, try to build new one from the project classpath
-// return this.buildPersistableExternalJavaResourcePersistentType(typeName);
- }
-
- public JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAbstractType.Kind kind) {
- JavaResourceAbstractType resourceType = getJavaResourceType(typeName);
- if (resourceType == null || resourceType.getKind() != kind) {
- return null;
- }
- return resourceType;
- }
-
- protected Iterable<JavaResourceAbstractType> getJavaResourceTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.getJavaResourceTypeSets());
- }
-
- protected Iterable<Iterable<JavaResourceAbstractType>> getJavaResourceTypeSets() {
- return new TransformationIterable<JavaResourceNode.Root, Iterable<JavaResourceAbstractType>>(
- this.getJavaResourceNodeRoots()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourceNode.Root root) {
- return root.getTypes();
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceNode.Root> getJavaResourceNodeRoots() {
- return new CompositeIterable<JavaResourceNode.Root>(
- this.getInternalJavaResourceCompilationUnits()/*,
- this.getInternalJavaResourcePackageFragmentRoots(),
- this.getExternalJavaResourceCompilationUnits(),
- Collections.singleton(this.externalJavaResourcePersistentTypeCache)*/
- );
- }
-
-
-// // ********** JARs **********
-//
-// // TODO
-// public JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName) {
-//// return this.getJarResourcePackageFragmentRoot(this.convertToPlatformFile(jarFileName));
-// return this.getJavaResourcePackageFragmentRoot(this.getProject().getFile(jarFileName));
-// }
-//
-// protected JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(IFile jarFile) {
-// for (JavaResourcePackageFragmentRoot pfr : this.getInternalJavaResourcePackageFragmentRoots()) {
-// if (pfr.getFile().equals(jarFile)) {
-// return pfr;
-// }
-// }
-// return null;
-// }
-//
-// protected Iterable<JavaResourcePackageFragmentRoot> getInternalJavaResourcePackageFragmentRoots() {
-// return new TransformationIterable<JpaFile, JavaResourcePackageFragmentRoot>(this.getJarJpaFiles()) {
-// @Override
-// protected JavaResourcePackageFragmentRoot transform(JpaFile jpaFile) {
-// return (JavaResourcePackageFragmentRoot) jpaFile.getResourceModel();
-// }
-// };
-// }
-//
-// /**
-// * return JPA files with JAR "content"
-// */
-// protected Iterable<JpaFile> getJarJpaFiles() {
-// return this.getJpaFiles(JptCorePlugin.JAR_CONTENT_TYPE);
-// }
-
-
-
-//
-// // ********** Java source folder names **********
-//
-// public Iterable<String> getJavaSourceFolderNames() {
-// try {
-// return this.getJavaSourceFolderNames_();
-// } catch (JavaModelException ex) {
-// JptCorePlugin.log(ex);
-// return EmptyIterable.instance();
-// }
-// }
-//
-// protected Iterable<String> getJavaSourceFolderNames_() throws JavaModelException {
-// return new TransformationIterable<IPackageFragmentRoot, String>(this.getJavaSourceFolders()) {
-// @Override
-// protected String transform(IPackageFragmentRoot pfr) {
-// try {
-// return this.transform_(pfr);
-// } catch (JavaModelException ex) {
-// return "Error: " + pfr.getPath(); //$NON-NLS-1$
-// }
-// }
-// private String transform_(IPackageFragmentRoot pfr) throws JavaModelException {
-// return pfr.getUnderlyingResource().getProjectRelativePath().toString();
-// }
-// };
-// }
-//
-// protected Iterable<IPackageFragmentRoot> getJavaSourceFolders() throws JavaModelException {
-// return new FilteringIterable<IPackageFragmentRoot>(
-// this.getPackageFragmentRoots(),
-// SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER
-// );
-// }
-//
-// protected static final Filter<IPackageFragmentRoot> SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER =
-// new Filter<IPackageFragmentRoot>() {
-// public boolean accept(IPackageFragmentRoot pfr) {
-// try {
-// return this.accept_(pfr);
-// } catch (JavaModelException ex) {
-// return false;
-// }
-// }
-// private boolean accept_(IPackageFragmentRoot pfr) throws JavaModelException {
-// return pfr.exists() && (pfr.getKind() == IPackageFragmentRoot.K_SOURCE);
-// }
-// };
-//
-// protected Iterable<IPackageFragmentRoot> getPackageFragmentRoots() throws JavaModelException {
-// return new ArrayIterable<IPackageFragmentRoot>(this.getJavaProject().getPackageFragmentRoots());
-// }
-
-
- // **************** jaxb.index resources **********************************
-
- public Iterable<JaxbIndexResource> getJaxbIndexResources() {
- return new TransformationIterable<JaxbFile, JaxbIndexResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE)) {
- @Override
- protected JaxbIndexResource transform(JaxbFile o) {
- return (JaxbIndexResource) o.getResourceModel();
- }
- };
- }
-
- public JaxbIndexResource getJaxbIndexResource(String packageName) {
- for (JaxbIndexResource jir : getJaxbIndexResources()) {
- if (packageName.equals(jir.getPackageName())) {
- return jir;
- }
- }
- return null;
- }
-
-
- // **************** jaxb.properties resources *****************************
-
- public Iterable<JaxbPropertiesResource> getJaxbPropertiesResources() {
- return new TransformationIterable<JaxbFile, JaxbPropertiesResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE)) {
- @Override
- protected JaxbPropertiesResource transform(JaxbFile o) {
- return (JaxbPropertiesResource) o.getResourceModel();
- }
- };
- }
-
- public JaxbPropertiesResource getJaxbPropertiesResource(String packageName) {
- for (JaxbPropertiesResource jpr : getJaxbPropertiesResources()) {
- if (packageName.equals(jpr.getPackageName())) {
- return jpr;
- }
- }
- return null;
- }
-
-
- // ********** Java events **********
-
- // TODO handle changes to external projects
- public void javaElementChanged(ElementChangedEvent event) {
- this.processJavaDelta(event.getDelta());
- }
-
- /**
- * We recurse back here from {@link #processJavaDeltaChildren(IJavaElementDelta)}.
- */
- protected void processJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- this.processJavaModelDelta(delta);
- break;
- case IJavaElement.JAVA_PROJECT :
- this.processJavaProjectDelta(delta);
- break;
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- this.processJavaPackageFragmentRootDelta(delta);
- break;
- case IJavaElement.PACKAGE_FRAGMENT :
- this.processJavaPackageFragmentDelta(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.processJavaCompilationUnitDelta(delta);
- break;
- default :
- break; // ignore the elements inside a compilation unit
- }
- }
-
- protected void processJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.processJavaDelta(child); // recurse
- }
- }
-
- /**
- * Return whether the specified Java element delta is for a
- * {@link IJavaElementDelta#CHANGED CHANGED}
- * (as opposed to {@link IJavaElementDelta#ADDED ADDED} or
- * {@link IJavaElementDelta#REMOVED REMOVED}) Java element
- * and the specified flag is set.
- * (The delta flags are only significant if the delta
- * {@link IJavaElementDelta#getKind() kind} is
- * {@link IJavaElementDelta#CHANGED CHANGED}.)
- */
- protected boolean deltaFlagIsSet(IJavaElementDelta delta, int flag) {
- return (delta.getKind() == IJavaElementDelta.CHANGED) &&
- BitTools.flagIsSet(delta.getFlags(), flag);
- }
-
- // ***** model
- protected void processJavaModelDelta(IJavaElementDelta delta) {
- // process the Java model's projects
- this.processJavaDeltaChildren(delta);
- }
-
- // ***** project
- protected void processJavaProjectDelta(IJavaElementDelta delta) {
- // process the Java project's package fragment roots
- this.processJavaDeltaChildren(delta);
-
- // a classpath change can have pretty far-reaching effects...
- if (this.classpathHasChanged(delta)) {
- this.rebuild((IJavaProject) delta.getElement());
- }
- }
-
- /**
- * The specified Java project's classpath changed. Rebuild the JPA project
- * as appropriate.
- */
- protected void rebuild(IJavaProject javaProject) {
- // if the classpath has changed, we need to update everything since
- // class references could now be resolved (or not) etc.
- if (javaProject.equals(this.getJavaProject())) {
- this.removeDeadJpaFiles();
- this.synchronizeWithJavaSource(this.getInternalJavaResourceCompilationUnits());
- } else {
- // TODO see if changed project is on our classpath?
- //this.synchronizeWithJavaSource(this.getExternalJavaResourceCompilationUnits());
- }
- }
-
- /**
- * Loop through all our JPA files, remove any that are no longer on the
- * classpath.
- */
- protected void removeDeadJpaFiles() {
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- if (this.jaxbFileIsDead(jaxbFile)) {
- this.removeJaxbFile(jaxbFile);
- }
- }
- }
-
- protected boolean jaxbFileIsDead(JaxbFile jaxbFile) {
- return ! this.jaxbFileIsAlive(jaxbFile);
- }
-
- /**
- * Sometimes (e.g. during tests), when a project has been deleted, we get a
- * Java change event that indicates the Java project is CHANGED (as
- * opposed to REMOVED, which is what typically happens). The event's delta
- * indicates that everything in the Java project has been deleted and the
- * classpath has changed. All entries in the classpath have been removed;
- * but single entry for the Java project's root folder has been added. (!)
- * This means any file in the project is on the Java project's classpath.
- * This classpath change is what triggers us to rebuild the JPA project; so
- * we put an extra check here to make sure the JPA file's resource file is
- * still present.
- * <p>
- * This would not be a problem if Dali received the resource change event
- * <em>before</em> JDT and simply removed the JPA project; but JDT receives
- * the resource change event first and converts it into the problematic
- * Java change event....
- */
- protected boolean jaxbFileIsAlive(JaxbFile jaxbFile) {
- IFile file = jaxbFile.getFile();
- return this.getJavaProject().isOnClasspath(file) &&
- file.exists();
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.JAVA_PROJECT
- */
- protected boolean classpathHasChanged(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED);
- }
-
- protected void synchronizeWithJavaSource(Iterable<JavaResourceCompilationUnit> javaResourceCompilationUnits) {
- for (JavaResourceCompilationUnit javaResourceCompilationUnit : javaResourceCompilationUnits) {
- javaResourceCompilationUnit.synchronizeWithJavaSource();
- }
- }
-
-
- // ***** package fragment root
- protected void processJavaPackageFragmentRootDelta(IJavaElementDelta delta) {
- // process the Java package fragment root's package fragments
- this.processJavaDeltaChildren(delta);
-
- if (this.classpathEntryHasBeenAdded(delta)) {
- // TODO bug 277218
- } else if (this.classpathEntryHasBeenRemoved(delta)) { // should be mutually-exclusive w/added (?)
- // TODO bug 277218
- }
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
- */
- protected boolean classpathEntryHasBeenAdded(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_ADDED_TO_CLASSPATH);
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
- */
- protected boolean classpathEntryHasBeenRemoved(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_REMOVED_FROM_CLASSPATH);
- }
-
- // ***** package fragment
- protected void processJavaPackageFragmentDelta(IJavaElementDelta delta) {
- // process the java package fragment's compilation units
- this.processJavaDeltaChildren(delta);
- }
-
- // ***** compilation unit
- protected void processJavaCompilationUnitDelta(IJavaElementDelta delta) {
- if (this.javaCompilationUnitDeltaIsRelevant(delta)) {
- ICompilationUnit compilationUnit = (ICompilationUnit) delta.getElement();
- for (JavaResourceCompilationUnit jrcu : this.getCombinedJavaResourceCompilationUnits()) {
- if (jrcu.getCompilationUnit().equals(compilationUnit)) {
- jrcu.synchronizeWithJavaSource();
- // TODO ? this.resolveJavaTypes(); // might have new member types now...
- break; // there *shouldn't* be any more...
- }
- }
- }
- // ignore the java compilation unit's children
- }
-
- protected boolean javaCompilationUnitDeltaIsRelevant(IJavaElementDelta delta) {
- // ignore changes to/from primary working copy - no content has changed;
- // and make sure there are no other flags set that indicate *both* a
- // change to/from primary working copy *and* content has changed
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return false;
- }
-
- // ignore java notification for ADDED or REMOVED;
- // these are handled via resource notification
- return delta.getKind() == IJavaElementDelta.CHANGED;
- }
-
-
- // ********** validation **********
-
- public Iterable<IMessage> getValidationMessages(IReporter reporter) {
- List<IMessage> messages = new ArrayList<IMessage>();
- this.validate(messages, reporter);
- return new SnapshotCloneIterable<IMessage>(messages);
- }
-
- protected void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
-
- getSchemaLibrary().refreshAllSchemas();
-
- validateLibraryProvider(messages);
- validateSchemaLibrary(messages);
- this.contextRoot.validate(messages, reporter);
- }
-
- protected void validateLibraryProvider(List<IMessage> messages) {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(getProject());
- }
- catch (CoreException ce) {
- // fall through
- JptJaxbCorePlugin.log(ce);
- }
-
- IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(JaxbFacet.FACET);
- LibraryInstallDelegate lid = new LibraryInstallDelegate(facetedProject, facetVersion);
- ILibraryProvider lp = lid.getLibraryProvider();
- if (lid.getLibraryProviderOperationConfig() instanceof JaxbLibraryProviderInstallOperationConfig) {
- ((JaxbLibraryProviderInstallOperationConfig) lid.getLibraryProviderOperationConfig()).setJaxbPlatform(getPlatform().getDescription());
- }
- if (! lp.isEnabledFor(facetedProject, facetVersion) || ! lid.validate().isOK()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT_INVALID_LIBRARY_PROVIDER,
- this));
- }
- lid.dispose();
- }
-
- protected void validateSchemaLibrary(List<IMessage> messages) {
- this.schemaLibrary.validate(messages);
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.contextModelSynchronizer.stop();
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- this.schemaLibrary.dispose();
- // the XML resources are held indefinitely by the WTP translator framework,
- // so we better remove our listener or the JAXB project will not be GCed
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- jaxbFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- }
- }
-
-
-
- // ********** resource model listener **********
-
- protected JptResourceModelListener buildResourceModelListener() {
- return new DefaultResourceModelListener();
- }
-
- protected class DefaultResourceModelListener
- implements JptResourceModelListener
- {
- protected DefaultResourceModelListener() {
- super();
- }
-
- public void resourceModelChanged(JptResourceModel jpaResourceModel) {
-// String msg = Thread.currentThread() + " resource model change: " + jpaResourceModel;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- AbstractJaxbProject.this.synchronizeContextModel(jpaResourceModel);
- }
-
- public void resourceModelReverted(JptResourceModel jpaResourceModel) {
-// IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
-// AbstractJaxbProject.this.removeJaxbFile(file);
-// AbstractJaxbProject.this.addJaxbFile(file);
- }
-
- public void resourceModelUnloaded(JptResourceModel jpaResourceModel) {
-// IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
-// AbstractJaxbProject.this.removeJaxbFile(file);
- }
- }
-
- protected void synchronizeContextModel(@SuppressWarnings("unused") JptResourceModel jpaResourceModel) {
- this.synchronizeContextModel();
- }
-
-
- // ********** resource events **********
-
- // TODO need to do the same thing for external projects and compilation units
- public void projectChanged(IResourceDelta delta) {
- if (delta.getResource().equals(this.getProject())) {
- this.internalProjectChanged(delta);
- } else {
-// this.externalProjectChanged(delta);
- }
- }
-
- protected void internalProjectChanged(IResourceDelta delta) {
- ResourceDeltaVisitor resourceDeltaVisitor = this.buildInternalResourceDeltaVisitor();
- resourceDeltaVisitor.visitDelta(delta);
- // at this point, if we have added and/or removed JpaFiles, an "update" will have been triggered;
- // any changes to the resource model during the "resolve" will trigger further "updates";
- // there should be no need to "resolve" external Java types (they can't have references to
- // the internal Java types)
- if (resourceDeltaVisitor.encounteredSignificantChange()) {
- this.resolveInternalJavaTypes();
- }
- }
-
- protected ResourceDeltaVisitor buildInternalResourceDeltaVisitor() {
- return new ResourceDeltaVisitor() {
- @Override
- public boolean fileChangeIsSignificant(IFile file, int deltaKind) {
- return AbstractJaxbProject.this.synchronizeJaxbFiles(file, deltaKind);
- }
- };
- }
-
- /**
- * Internal resource delta visitor callback.
- * Return true if a JaxbFile was either added or removed.
- */
- protected boolean synchronizeJaxbFiles(IFile file, int deltaKind) {
- switch (deltaKind) {
- case IResourceDelta.ADDED :
- return this.addJaxbFile(file);
- case IResourceDelta.REMOVED :
- return this.removeJaxbFile(file);
- case IResourceDelta.CHANGED :
- return this.checkForChangedFileContent(file);
- case IResourceDelta.ADDED_PHANTOM :
- break; // ignore
- case IResourceDelta.REMOVED_PHANTOM :
- break; // ignore
- default :
- break; // only worried about added/removed/changed files
- }
-
- return false;
- }
-
- protected boolean checkForChangedFileContent(IFile file) {
- JaxbFile jaxbFile = this.getJaxbFile(file);
- if (jaxbFile == null) {
- // the file might have changed its content to something that we are interested in
- return this.addJaxbFile(file);
- }
-
- if (jaxbFile.getContentType().equals(PlatformTools.getContentType(file))) {
- // content has not changed - ignore
- return false;
- }
-
- // the content type changed, we need to build a new JPA file
- // (e.g. the schema of an orm.xml file changed from JPA to EclipseLink)
- this.removeJaxbFile(jaxbFile);
- this.addJaxbFile(file);
- return true; // at the least, we have removed a JPA file
- }
-
- protected void resolveInternalJavaTypes() {
- for (JavaResourceCompilationUnit jrcu : this.getInternalJavaResourceCompilationUnits()) {
- jrcu.resolveTypes();
- }
- }
-
-// protected void externalProjectChanged(IResourceDelta delta) {
-// if (this.getJavaProject().isOnClasspath(delta.getResource())) {
-// ResourceDeltaVisitor resourceDeltaVisitor = this.buildExternalResourceDeltaVisitor();
-// resourceDeltaVisitor.visitDelta(delta);
-// // force an "update" here since adding and/or removing an external Java type
-// // will only trigger an "update" if the "resolve" causes something in the resource model to change
-// if (resourceDeltaVisitor.encounteredSignificantChange()) {
-// this.update();
-// this.resolveExternalJavaTypes();
-// this.resolveInternalJavaTypes();
-// }
-// }
-// }
-//
-// protected ResourceDeltaVisitor buildExternalResourceDeltaVisitor() {
-// return new ResourceDeltaVisitor() {
-// @Override
-// public boolean fileChangeIsSignificant(IFile file, int deltaKind) {
-// return AbstractJaxbProject.this.synchronizeExternalFiles(file, deltaKind);
-// }
-// };
-// }
-//
-// /**
-// * external resource delta visitor callback
-// * Return true if an "external" Java resource compilation unit
-// * was added or removed.
-// */
-// protected boolean synchronizeExternalFiles(IFile file, int deltaKind) {
-// switch (deltaKind) {
-// case IResourceDelta.ADDED :
-// return this.externalFileAdded(file);
-// case IResourceDelta.REMOVED :
-// return this.externalFileRemoved(file);
-// case IResourceDelta.CHANGED :
-// break; // ignore
-// case IResourceDelta.ADDED_PHANTOM :
-// break; // ignore
-// case IResourceDelta.REMOVED_PHANTOM :
-// break; // ignore
-// default :
-// break; // only worried about added/removed/changed files
-// }
-//
-// return false;
-// }
-//
-// protected boolean externalFileAdded(IFile file) {
-// IContentType contentType = PlatformTools.getContentType(file);
-// if (contentType == null) {
-// return false;
-// }
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return true;
-// }
-// if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return true;
-// }
-// return false;
-// }
-//
-// protected boolean externalFileRemoved(IFile file) {
-// IContentType contentType = PlatformTools.getContentType(file);
-// if (contentType == null) {
-// return false;
-// }
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return this.removeExternalJavaResourceCompilationUnit(file);
-// }
-// if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return this.externalJavaResourcePersistentTypeCache.removePersistentTypes(file);
-// }
-// return false;
-// }
-//
-// protected void resolveExternalJavaTypes() {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// jrcu.resolveTypes();
-// }
-// }
-
- // ***** resource delta visitors
- /**
- * add or remove a JPA file for every [appropriate] file encountered by the visitor
- */
- protected abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected boolean encounteredSignificantChange = false;
-
- protected ResourceDeltaVisitor() {
- super();
- }
-
- protected void visitDelta(IResourceDelta delta) {
- try {
- delta.accept(this);
- } catch (CoreException ex) {
- // shouldn't happen - we don't throw any CoreExceptions
- throw new RuntimeException(ex);
- }
- }
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- this.fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (this.fileChangeIsSignificant(file, deltaKind)) {
- this.encounteredSignificantChange = true;
- }
- }
-
- protected abstract boolean fileChangeIsSignificant(IFile file, int deltaKind);
-
- /**
- * Return whether the visitor encountered some sort of "significant"
- * change while traversing the IResourceDelta
- * (e.g. a JPA file was added or removed).
- */
- protected boolean encounteredSignificantChange() {
- return this.encounteredSignificantChange;
- }
-
- }
-
-
- // ********** support for modifying documents shared with the UI **********
-
- public void setThreadLocalModifySharedDocumentCommandExecutor(ExtendedCommandExecutor commandExecutor) {
- this.modifySharedDocumentCommandExecutor.set(commandExecutor);
- }
-
- public ExtendedCommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
-
- // ********** synchronize context model with resource model **********
-
- public Synchronizer getContextModelSynchronizer() {
- return this.contextModelSynchronizer;
- }
-
- public void setContextModelSynchronizer(Synchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.contextModelSynchronizer.stop();
- this.setContextModelSynchronizer_(synchronizer);
- }
-
- protected void setContextModelSynchronizer_(Synchronizer synchronizer) {
- this.contextModelSynchronizer = synchronizer;
- this.contextModelSynchronizer.start();
- }
-
- /**
- * Delegate to the context model synchronizer so clients can configure how
- * synchronizations occur.
- */
- public void synchronizeContextModel() {
- this.synchronizingContextModel = true;
- this.contextModelSynchronizer.synchronize();
- this.synchronizingContextModel = false;
-
- // There are some changes to the resource model that will not change
- // the existing context model and trigger an update (e.g. adding an
- // @Entity annotation when the the JPA project is automatically
- // discovering annotated classes); so we explicitly execute an update
- // here to discover those changes.
- this.update();
- }
-
- /**
- * Called by the context model synchronizer.
- */
- public IStatus synchronizeContextModel(IProgressMonitor monitor) {
- this.contextRoot.synchronizeWithResourceModel();
- return Status.OK_STATUS;
- }
-
- public void synchronizeContextModelAndWait() {
- Synchronizer temp = this.contextModelSynchronizer;
- this.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
- this.synchronizeContextModel();
- this.setContextModelSynchronizer(temp);
- }
-
-
- // ********** default context model synchronizer (synchronous) **********
-
- protected Synchronizer buildSynchronousContextModelSynchronizer() {
- return new SynchronousSynchronizer(this.buildSynchronousContextModelSynchronizerCommand());
- }
-
- protected Command buildSynchronousContextModelSynchronizerCommand() {
- return new SynchronousContextModelSynchronizerCommand();
- }
-
- protected class SynchronousContextModelSynchronizerCommand
- implements Command
- {
- public void execute() {
- AbstractJaxbProject.this.synchronizeContextModel(new NullProgressMonitor());
- }
- }
-
-
- // ********** project "update" **********
-
- public CallbackSynchronizer getUpdateSynchronizer() {
- return this.updateSynchronizer;
- }
-
- public void setUpdateSynchronizer(CallbackSynchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- this.setUpdateSynchronizer_(synchronizer);
- }
-
- protected void setUpdateSynchronizer_(CallbackSynchronizer synchronizer) {
- this.updateSynchronizer = synchronizer;
- this.updateSynchronizer.addListener(this.updateSynchronizerListener);
- this.updateSynchronizer.start();
- }
-
- @Override
- public void stateChanged() {
- super.stateChanged();
- this.update();
- }
-
- /**
- * The JAXB project's state has changed, "update" those parts of the
- * JAXB project that are dependent on other parts of the JAXB project.
- * <p>
- * Delegate to the update synchronizer so clients can configure how
- * updates occur.
- * <p>
- * Ignore any <em>updates</em> that occur while we are synchronizing
- * the context model with the resource model because we will <em>update</em>
- * the context model at the completion of the <em>sync</em>. This is really
- * only useful for synchronous <em>syncs</em> and <em>updates</em>; since
- * the job scheduling rules will prevent the <em>sync</em> and
- * <em>update</em> jobs from running concurrently.
- *
- * @see #updateAndWait()
- */
- protected void update() {
- if ( ! this.synchronizingContextModel) {
- this.updateSynchronizer.synchronize();
- }
- }
-
- /**
- * Called by the update synchronizer.
- */
- public IStatus update(IProgressMonitor monitor) {
- this.contextRoot.update();
- return Status.OK_STATUS;
- }
-
- /**
- * This is the callback used by the update synchronizer to notify the JAXB
- * project that the "update" has quiesced (i.e. the "update" has completed
- * and there are no outstanding requests for further "updates").
- */
- public void updateQuiesced() {
- //nothing yet
- }
-
- public void updateAndWait() {
- CallbackSynchronizer temp = this.updateSynchronizer;
- this.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
- this.update();
- this.setUpdateSynchronizer(temp);
- }
-
-
- // ********** default update synchronizer (synchronous) **********
-
- protected CallbackSynchronizer buildSynchronousUpdateSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildSynchronousUpdateSynchronizerCommand());
- }
-
- protected Command buildSynchronousUpdateSynchronizerCommand() {
- return new SynchronousUpdateSynchronizerCommand();
- }
-
- protected class SynchronousUpdateSynchronizerCommand
- implements Command
- {
- public void execute() {
- AbstractJaxbProject.this.update(new NullProgressMonitor());
- }
- }
-
-
- // ********** update synchronizer listener **********
-
- protected CallbackSynchronizer.Listener buildUpdateSynchronizerListener() {
- return new UpdateSynchronizerListener();
- }
-
- protected class UpdateSynchronizerListener
- implements CallbackSynchronizer.Listener
- {
- public void synchronizationQuiesced(CallbackSynchronizer synchronizer) {
- AbstractJaxbProject.this.updateQuiesced();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java
deleted file mode 100644
index 574ad14301..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-/**
- * The transition between a JAXB project and the resource model associated
- * with a file.
- * Hold the associated root structure nodes, which are hooks to the
- * context model.
- */
-public class GenericJaxbFile
- extends AbstractJaxbNode
- implements JaxbFile
-{
- /**
- * typically a .java or .xml file.
- */
- protected final IFile file;
-
- /**
- * cache the content type - if the content type changes, the JAXB project
- * will throw out the JAXB file and build a new one
- */
- protected final IContentType contentType;
-
- /**
- * the resource model corresponding to the file
- */
- protected final JptResourceModel resourceModel;
-
-// /**
-// * the root structure (context model) nodes corresponding to the resource
-// * model
-// */
-// protected final Hashtable<Object, JpaStructureNode> rootStructureNodes;
-
-
- // ********** construction **********
-
- public GenericJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel) {
- super(jaxbProject);
- this.file = file;
- this.contentType = contentType;
- this.resourceModel = resourceModel;
-// this.rootStructureNodes = new Hashtable<Object, JpaStructureNode>();
- }
-//
-// /**
-// * Changes to ROOT_STRUCTURE_NODES_COLLECTION do not need to trigger a
-// * project update. Only the UI cares about the root structure nodes.
-// * If a project update is allowed to happen, an infinite loop will result
-// * if any java class is specified in more than one location in the
-// * persistence unit.
-// */
-// @Override
-// protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
-// super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
-// nonUpdateAspectNames.add(ROOT_STRUCTURE_NODES_COLLECTION);
-// }
-
-
- // ********** file **********
-
- public IFile getFile() {
- return this.file;
- }
-
- public IContentType getContentType() {
- return this.contentType;
- }
-
- public JptResourceModel getResourceModel() {
- return this.resourceModel;
- }
-
- public JptResourceModel getResourceModel(IContentType ct) {
- return this.contentType.isKindOf(ct) ? this.resourceModel : null;
- }
-
-
-// // ********** root structure nodes **********
-//
-// public Iterator<JpaStructureNode> rootStructureNodes() {
-// return this.getRootStructureNodes().iterator();
-// }
-//
-// protected Iterable<JpaStructureNode> getRootStructureNodes() {
-// return new LiveCloneIterable<JpaStructureNode>(this.rootStructureNodes.values());
-// }
-//
-// public int rootStructureNodesSize() {
-// return this.rootStructureNodes.size();
-// }
-//
-// public void addRootStructureNode(Object key, JpaStructureNode rootStructureNode) {
-// JpaStructureNode old = this.rootStructureNodes.put(key, rootStructureNode);
-// if (rootStructureNode != old) {
-// if (old != null) {
-// this.fireItemRemoved(ROOT_STRUCTURE_NODES_COLLECTION, old);
-// }
-// this.fireItemAdded(ROOT_STRUCTURE_NODES_COLLECTION, rootStructureNode);
-// }
-// }
-//
-// public void removeRootStructureNode(Object key) {
-// this.fireItemRemoved(ROOT_STRUCTURE_NODES_COLLECTION, this.rootStructureNodes.remove(key));
-// }
-//
-// public JpaStructureNode getStructureNode(int textOffset) {
-// for (JpaStructureNode rootNode : this.getRootStructureNodes()) {
-// JpaStructureNode node = rootNode.getStructureNode(textOffset);
-// if (node != null) {
-// return node;
-// }
-// }
-// return null;
-// }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.file);
- sb.append('[');
- sb.append(this.contentType.getName());
- sb.append(']');
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java
deleted file mode 100644
index 1b81017142..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-/**
- * Not much different from the abstract JAXB project.
- */
-public class GenericJaxbProject
- extends AbstractJaxbProject
-{
-
- // ********** constructor/initialization **********
-
- public GenericJaxbProject(JaxbProject.Config config) {
- super(config);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
deleted file mode 100644
index df776cf336..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-/**
- * Factory to build Dali adapters for an {@link IJavaElement}:<ul>
- * <li>{@link JaxbPlatformDescription}
- * </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
- */
-public class JavaElementAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JaxbPlatformDescription.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IJavaElement) {
- return this.getAdapter((IJavaElement) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IJavaElement javaElement, Class<?> adapterType) {
- if (adapterType == JaxbPlatformDescription.class) {
- return javaElement.getResource().getAdapter(JaxbPlatformDescription.class);
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
deleted file mode 100644
index 82ca5ea88d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-/**
- * Java package-info.java source code
- */
-public class JavaPackageInfoResourceModelProvider
- implements JaxbResourceModelProvider
-{
- // singleton
- private static final JaxbResourceModelProvider INSTANCE = new JavaPackageInfoResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaPackageInfoResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
- ICompilationUnit compilationUnit = JavaCore.createCompilationUnitFrom(file);
- try {
- if (compilationUnit.getPackageDeclarations().length > 0){
- return new SourcePackageInfoCompilationUnit(
- compilationUnit,
- jaxbProject.getPlatform().getAnnotationProvider(),
- jaxbProject.getPlatform().getAnnotationEditFormatter(),
- jaxbProject.getModifySharedDocumentCommandExecutor());
- }
- //ignore package-info placed in default package as
- //it doesn't have package declaration and can't hold annotations
- return null;
- } catch (JavaModelException e) {
- JptJaxbCorePlugin.log(e);
- // Ignore -- project is in a bad state. This will get recalled if necessary
- return null;
- }
- }
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
deleted file mode 100644
index 4066f112c8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-
-/**
- * Java source code
- */
-public class JavaResourceModelProvider
- implements JaxbResourceModelProvider
-{
- // singleton
- private static final JaxbResourceModelProvider INSTANCE = new JavaResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return new SourceTypeCompilationUnit(
- JavaCore.createCompilationUnitFrom(file),
- jaxbProject.getPlatform().getAnnotationProvider(),
- jaxbProject.getPlatform().getAnnotationEditFormatter(),
- jaxbProject.getModifySharedDocumentCommandExecutor()
- );
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
deleted file mode 100644
index 1ddbcdc20f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali JAXB Core.
- */
-public class JptJaxbCoreMessages {
-
- public static String CONTEXT_MODEL_SYNC_JOB_NAME;
- public static String UPDATE_JOB_NAME;
- public static String PREFERENCES_FLUSH_JOB_NAME;
-
- public static String ClassesGenerator_generatingClasses;
- public static String ClassesGenerator_generatingClassesTask;
-
- public static String JaxbFacetConfig_validatePlatformNotSpecified;
- public static String JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion;
-
- public static String JreLibraryValidator_invalidPlatform;
- public static String JreLibraryValidator_invalidJavaFacet;
- public static String JreLibraryValidator_invalidJavaLibrary;
-
- public static String UserLibraryValidator_incompatibleJavaFacet;
- public static String UserLibraryValidator_incompatibleJavaLibrary;
-
- public static String SchemaGenerator_creatingJAXBPropertiesFileTask;
-
- public static String XML_ATTRIBUTE_DESC;
- public static String XML_ELEMENT_DESC;
- public static String XML_TYPE_DESC;
- public static String SUBSTITUTION_HEAD_DESC;
-
- public static String XML_ELEMENT_DECL__SCOPE;
-
-
- private static final String BUNDLE_NAME = "jpt_jaxb_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJaxbCoreMessages.class;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
-
- private JptJaxbCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
deleted file mode 100644
index 85857f5824..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-/**
- * Factory to build Dali adapters for an {@link IResource}:<ul>
- * <li>{@link JaxbPlatformDescription}
- * </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
- */
-public class ResourceAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JaxbPlatformDescription.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IResource) {
- return this.getAdapter((IResource) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IResource resource, Class<?> adapterType) {
- if (adapterType == JaxbPlatformDescription.class) {
- return this.getJaxbPlatformDescription(resource);
- }
- return null;
- }
-
- private JaxbPlatformDescription getJaxbPlatformDescription(IResource resource) {
- return JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(JptJaxbCorePlugin.getJaxbPlatformId(resource.getProject()));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java
deleted file mode 100644
index a60839602d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-
-public class SchemaEntryImpl
- implements SchemaEntry {
-
- private final String location;
-
- private String namespace;
-
- private XSDResourceImpl schemaResource;
-
- private boolean unloaded = false;
-
- private SchemaResourceAdapter schemaResourceAdapter;
-
-
- SchemaEntryImpl(String location) {
- this.location = location;
- this.schemaResourceAdapter = new SchemaResourceAdapter();
- refresh();
- }
-
-
- public String getLocation() {
- return this.location;
- }
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public boolean isLoaded() {
- return this.schemaResource != null;
- }
-
- public XsdSchema getXsdSchema(String namespace) {
- if (this.unloaded) {
- refresh();
- this.unloaded = false;
- }
-
- if (! StringTools.stringsAreEqual(this.namespace, namespace)) {
- return null;
- }
-
- if (this.schemaResource != null) {
- return XsdUtil.getSchema(this.schemaResource.getSchema());
- }
-
- return null;
- }
-
- public void refresh() {
- unload();
-
- String resolvedUri = XsdUtil.getResolvedUri(this.location);
- if (resolvedUri == null) {
- return;
- }
-
- XSDSchema schema = XsdUtil.buildXSDModel(resolvedUri);
- XSDResourceImpl schemaResource = (schema == null) ? null : (XSDResourceImpl) schema.eResource();
-
- if (schemaResource != null) {
- schemaResource.eAdapters().add(this.schemaResourceAdapter);
- this.schemaResource = schemaResource;
- String namespace = schema.getTargetNamespace();
- this.namespace = (namespace == null) ? "" : namespace;
- }
- }
-
- void unload() {
- if (this.schemaResource != null) {
- this.schemaResource.eAdapters().remove(this.schemaResourceAdapter);
- }
- this.unloaded = true;
- this.schemaResource = null;
- }
-
- void dispose() {
- if (this.schemaResource != null) {
- this.schemaResource.eAdapters().remove(this.schemaResourceAdapter);
- }
- }
-
-
-
- private class SchemaResourceAdapter
- extends AdapterImpl {
-
- @Override
- public void notifyChanged(Notification msg) {
- if (msg.getFeatureID(Resource.class) == Resource.RESOURCE__IS_LOADED
- && msg.getNewBooleanValue() == false) {
- SchemaEntryImpl.this.unload();
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
deleted file mode 100644
index 66c88c7232..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class SchemaLibraryImpl
- implements SchemaLibrary {
-
- private JaxbProject project;
-
- private final List<SchemaEntryImpl> schemaEntries;
-
- private final Map<String, SchemaEntryImpl> impliedEntries;
-
-
- SchemaLibraryImpl(JaxbProject project) {
- this.project = project;
- this.schemaEntries = new Vector<SchemaEntryImpl>();
- this.impliedEntries = new Hashtable<String, SchemaEntryImpl>();
- readProjectPreferences();
- }
-
-
- public List<SchemaEntry> getSchemaEntries() {
- return Collections.<SchemaEntry>unmodifiableList(this.schemaEntries);
- }
-
- public List<String> getSchemaLocations() {
- return Collections.unmodifiableList(
- CollectionTools.list(
- new TransformationIterable<SchemaEntry, String>(this.schemaEntries) {
- @Override
- protected String transform(SchemaEntry o) {
- return o.getLocation();
- }
- }));
- }
-
- public void setSchemaLocations(List<String> schemaLocations) {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- entry.dispose();
- }
- this.schemaEntries.clear();
- JptJaxbCorePlugin.setSchemaLocations(this.project.getProject(), schemaLocations);
- readProjectPreferences();
- }
-
- public XsdSchema getSchema(String namespace) {
- for (SchemaEntry entry : this.schemaEntries) {
- if (StringTools.stringsAreEqual(namespace, entry.getNamespace())) {
- return entry.getXsdSchema(namespace);
- }
- }
-
- if (! this.impliedEntries.containsKey(namespace)) {
- if (! StringTools.stringsAreEqual(XsdUtil.getResolvedUri(namespace), namespace)) {
- // the namespace itself resolves to a location. add it as an implied entry
- this.impliedEntries.put(namespace, new SchemaEntryImpl(namespace));
- }
- else {
- return null;
- }
- }
-
- return this.impliedEntries.get(namespace).getXsdSchema(namespace);
- }
-
- protected void readProjectPreferences() {
- List<String> schemas = JptJaxbCorePlugin.getSchemaLocations(this.project.getProject());
- for (String schemaLocation : schemas) {
- SchemaEntryImpl entry = new SchemaEntryImpl(schemaLocation);
- this.schemaEntries.add(entry);
- }
- }
-
- public void refreshSchema(String namespace) {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- if (StringTools.stringsAreEqual(namespace, entry.getNamespace())) {
- entry.refresh();
- }
- }
- }
-
- public void refreshAllSchemas() {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- entry.refresh();
- }
- }
-
- void dispose() {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- entry.dispose();
- }
- for (SchemaEntryImpl entry : this.impliedEntries.values()) {
- entry.dispose();
- }
-
- this.schemaEntries.clear();
- this.impliedEntries.clear();
- }
-
- public void validate(List<IMessage> messages) {
- Bag<String> namespaces = new HashBag<String>();
-
- for (SchemaEntry entry : this.schemaEntries) {
- namespaces.add(entry.getNamespace());
-
- if (! entry.isLoaded()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT__UNRESOLVED_SCHEMA,
- new String[] { entry.getLocation() },
- this.project));
- }
- }
-
- for (Iterator<String> stream = namespaces.uniqueIterator(); stream.hasNext(); ) {
- String namespace = stream.next();
- if (namespaces.count(namespace) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT__DUPLICATE_NAMESPACE,
- new String[] { namespace },
- this.project));
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java
deleted file mode 100644
index f159ded880..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-/**
- * Straightforward implementation of the JAXB project config.
- */
-public class SimpleJaxbProjectConfig
- implements JaxbProject.Config {
-
- private IProject project;
-
- private JaxbPlatformDefinition platformDefinition;
-
-
- public SimpleJaxbProjectConfig() {
- super();
- }
-
-
- public IProject getProject() {
- return this.project;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
- public JaxbPlatformDefinition getPlatformDefinition() {
- return this.platformDefinition;
- }
-
- public void setPlatformDefinition(JaxbPlatformDefinition platformDefinition) {
- this.platformDefinition = platformDefinition;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.project.getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
deleted file mode 100644
index 5e270b27f4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbNode;
-
-public abstract class AbstractJaxbContextNode
- extends AbstractJaxbNode
- implements JaxbContextNode
-{
-
- // ********** constructor **********
-
- protected AbstractJaxbContextNode(JaxbNode parent) {
- super(parent);
- }
-
-
- // ********** synchronize/update **********
-
- public void synchronizeWithResourceModel() {
- // NOP
- }
-
- /**
- * convenience method
- */
- protected void synchronizeNodesWithResourceModel(Iterable<? extends JaxbContextNode> nodes) {
- for (JaxbContextNode node : nodes) {
- node.synchronizeWithResourceModel();
- }
- }
-
- public void update() {
- // NOP
- }
-
- /**
- * convenience method
- */
- protected void updateNodes(Iterable<? extends JaxbContextNode> nodes) {
- for (JaxbContextNode node : nodes) {
- node.update();
- }
- }
-
- // ********** containment hierarchy **********
-
- /**
- * covariant override
- */
- @Override
- public JaxbContextNode getParent() {
- return (JaxbContextNode) super.getParent();
- }
-
- /**
- * Overridden in:<ul>
- * <li>{@link org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode#getResourceType() AbstractJavaContextNode}
- * </ul>
- */
- public JptResourceType getResourceType() {
- return getParent().getResourceType();
- }
-
- /**
- * Overridden in:<ul>
- * <li>{@link org.eclipse.jpt.jaxb.core.internal.context.GenericContextRoot#getContextRoot() GenericContextRoot}
- * to return itself>
- * </ul>
- */
- public JaxbContextRoot getContextRoot() {
- return getParent().getContextRoot();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java
deleted file mode 100644
index 373f603335..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * the context model root
- */
-public abstract class AbstractJaxbContextRoot
- extends AbstractJaxbContextNode
- implements JaxbContextRoot {
-
- /* This object has no parent, so it must point to the JAXB project explicitly. */
- protected final JaxbProject jaxbProject;
-
- /* The map of package name to JaxbPackage objects */
- protected final Map<String, JaxbPackage> packages;
-
- /* The map of class name to JaxbType objects */
- protected final Map<String, JaxbType> types;
-
-
- public AbstractJaxbContextRoot(JaxbProject jaxbProject) {
- super(null); // the JAXB project is not really a "parent"...
- if (jaxbProject == null) {
- throw new NullPointerException();
- }
- this.jaxbProject = jaxbProject;
- this.packages = new Hashtable<String, JaxbPackage>();
- this.types = new Hashtable<String, JaxbType>();
- initialize();
- }
-
-
- @Override
- public JaxbContextRoot getContextRoot() {
- return this;
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- protected void initialize() {
-
- // process packages with annotations first
- for (String pkg : calculateInitialPackageNames()) {
- this.packages.put(pkg, buildPackage(pkg));
- }
-
- // keep set of total types for remaining package initialization
- Set<String> totalTypeNames = new HashSet<String>();
-
- // process types with annotations and in jaxb.index files
- for (JavaResourceAbstractType resourceType : calculateInitialTypes()) {
- totalTypeNames.add(resourceType.getQualifiedName());
- addType_(buildType(resourceType));
- }
-
- // once all classes have been processed, add packages
- for (String pkg : calculatePackageNames(totalTypeNames)) {
- if (! this.packages.containsKey(pkg)) {
- this.packages.put(pkg, buildPackage(pkg));
- }
- }
-
-// // keep a master list of all types that we've processed so we don't process them again
-// final Set<String> totalTypes = CollectionTools.<String>set();
-//
-// // keep an running list of types that we need to scan for further referenced types
-// final Set<String> typesToScan = CollectionTools.<String>set();
-//
-// // process packages with annotations first
-// for (String pkg : calculateInitialPackageNames()) {
-// this.packages.put(pkg, buildPackage(pkg));
-// }
-//
-// // calculate initial types (annotated or listed in jaxb.index files)
-// final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialTypes();
-//
-// // while there are resource types to process or types to scan, continue to do so
-// while (! resourceTypesToProcess.isEmpty() || ! typesToScan.isEmpty()) {
-// for (JavaResourceAbstractType resourceType : new SnapshotCloneIterable<JavaResourceAbstractType>(resourceTypesToProcess)) {
-// String className = resourceType.getQualifiedName();
-// totalTypes.add(className);
-// typesToScan.add(className);
-// addType_(buildType(resourceType));
-// resourceTypesToProcess.remove(resourceType);
-// }
-//
-// for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
-// JaxbType jaxbType = getType(typeToScan);
-// if (jaxbType != null) {
-// for (String referencedTypeName : jaxbType.getReferencedXmlTypeNames()) {
-// if (! totalTypes.contains(referencedTypeName)) {
-// JavaResourceAbstractType referencedType = getJaxbProject().getJavaResourceType(referencedTypeName);
-// if (referencedType != null) {
-// resourceTypesToProcess.add(referencedType);
-// }
-// }
-// }
-// }
-// typesToScan.remove(typeToScan);
-// }
-// }
-//
-// // once all classes have been processed, add packages
-// for (String pkg : calculatePackageNames(totalTypes)) {
-// if (! this.packages.containsKey(pkg)) {
-// this.packages.put(pkg, buildPackage(pkg));
-// }
-// }
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- for (JaxbPackage each : getPackages()) {
- each.synchronizeWithResourceModel();
- }
- for (JaxbType each : getTypes()) {
- each.synchronizeWithResourceModel();
- }
- }
-
- @Override
- public void update() {
- super.update();
-
- // keep a master list of these so that objects are updated only once
- final Set<String> packagesToUpdate = CollectionTools.<String>set();
- final Set<String> typesToUpdate = CollectionTools.<String>set();
-
- // keep a (shrinking) running list of these so that we know which ones we do eventually need to remove
- final Set<String> packagesToRemove = CollectionTools.set(this.packages.keySet());
- final Set<String> typesToRemove = CollectionTools.set(this.types.keySet());
-
- // keep a master list of all types that we've processed so we don't process them again
- final Set<String> totalTypes = CollectionTools.<String>set();
-
- // keep an running list of types that we need to scan for further referenced types
- final Set<String> typesToScan = CollectionTools.<String>set();
-
- // process packages with annotations first
- for (String pkg : calculateInitialPackageNames()) {
- if (this.packages.containsKey(pkg)) {
- packagesToUpdate.add(pkg);
- packagesToRemove.remove(pkg);
- }
- else {
- this.addPackage(this.buildPackage(pkg));
- }
- }
-
- // calculate initial types (annotated or listed in jaxb.index files)
- final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialTypes();
-
- // store set of types that are referenced (and should therefore be default mapped)
- final Set<JavaResourceAbstractType> referencedTypes = new HashSet<JavaResourceAbstractType>();
-
- // while there are resource types to process or types to scan, continue to do so
- while (! resourceTypesToProcess.isEmpty() || ! typesToScan.isEmpty()) {
- for (JavaResourceAbstractType resourceType : new SnapshotCloneIterable<JavaResourceAbstractType>(resourceTypesToProcess)) {
- String className = resourceType.getQualifiedName();
- typesToRemove.remove(className);
- totalTypes.add(className);
- typesToScan.add(className);
- processType(resourceType, typesToUpdate, referencedTypes.contains(resourceType));
- resourceTypesToProcess.remove(resourceType);
- }
-
- for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
- JaxbType jaxbType = getType(typeToScan);
- if (jaxbType != null) {
- for (String referencedTypeName : jaxbType.getReferencedXmlTypeNames()) {
- if (! StringTools.stringIsEmpty(referencedTypeName) && ! totalTypes.contains(referencedTypeName)) {
- JavaResourceAbstractType referencedType = getJaxbProject().getJavaResourceType(referencedTypeName);
- if (referencedType != null) {
- resourceTypesToProcess.add(referencedType);
- referencedTypes.add(referencedType);
- }
- }
- }
- }
- typesToScan.remove(typeToScan);
- }
- }
-
- // once all classes have been processed, add packages
- for (String pkg : calculatePackageNames(totalTypes)) {
- if (this.packages.containsKey(pkg)) {
- packagesToUpdate.add(pkg);
- packagesToRemove.remove(pkg);
- }
- else {
- this.addPackage(this.buildPackage(pkg));
- }
- }
-
- for (String packageToUpdate : packagesToUpdate) {
- this.packages.get(packageToUpdate).update();
- }
-
- for (String typeToUpdate : typesToUpdate) {
- this.types.get(typeToUpdate).update();
- }
-
- for (String packageToRemove : packagesToRemove) {
- removePackage(packageToRemove);
- }
-
- for (String typeToRemove : typesToRemove) {
- removeType(typeToRemove);
- }
- }
-
- /**
- * calculate set of packages that can be determined purely by presence of package annotations
- */
- protected Set<String> calculateInitialPackageNames() {
- return CollectionTools.set(
- new TransformationIterable<JavaResourcePackage, String>(
- getJaxbProject().getAnnotatedJavaResourcePackages()) {
- @Override
- protected String transform(JavaResourcePackage o) {
- return o.getName();
- }
- });
- }
-
- /**
- * calculate set of packages that can be determined from type names
- */
- protected Set<String> calculatePackageNames(Set<String> typeNames) {
- Set<String> packageNames = CollectionTools.<String>set();
- for (String typeName : typeNames) {
- JaxbType jaxbType = this.types.get(typeName);
- if (jaxbType != null) {
- packageNames.add(jaxbType.getPackageName());
- }
- }
- return packageNames;
- }
-
- /*
- * Calculate set of initial types
- * This should be:
- * - all resource types with @XmlType, @XmlRootElement, or @XmlJavaTypeAdapter
- * - all resource classes with @XmlRegistry
- * - all resource enums with @XmlEnum
- * - all types listed in jaxb.index files.
- */
- protected Set<JavaResourceAbstractType> calculateInitialTypes() {
- Set<JavaResourceAbstractType> set = CollectionTools.set(
- new FilteringIterable<JavaResourceAbstractType>(
- getJaxbProject().getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType o) {
- if (o.getKind() == JavaResourceAbstractType.Kind.TYPE) {
- if (o.getAnnotation(JAXB.XML_REGISTRY) != null) {
- return true;
- }
- }
- if (o.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- if (o.getAnnotation(JAXB.XML_ENUM) != null) {
- return true;
- }
- }
- return o.getAnnotation(JAXB.XML_TYPE) != null
- || o.getAnnotation(JAXB.XML_ROOT_ELEMENT) != null
- || o.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER) > 0;
- }
- });
- CollectionTools.addAll(
- set,
- new FilteringIterable<JavaResourceAbstractType>(
- new TransformationIterable<String, JavaResourceAbstractType>(
- new CompositeIterable<String>(
- new TransformationIterable<JaxbIndexResource, Iterable<String>>(getJaxbProject().getJaxbIndexResources()) {
- @Override
- protected Iterable<String>transform(JaxbIndexResource o) {
- return o.getFullyQualifiedClassNames();
- }
- })) {
- @Override
- protected JavaResourceAbstractType transform(String o) {
- return getJaxbProject().getJavaResourceType(o);
- }
- },
- NotNullFilter.<JavaResourceAbstractType>instance()));
- return set;
- }
-
- protected void processType(JavaResourceAbstractType resourceType, Set<String> typesToUpdate, boolean defaultMapped) {
- JaxbType.Kind jaxbTypeKind = calculateJaxbTypeKind(resourceType);
- String className = resourceType.getQualifiedName();
-
- if (this.types.containsKey(className)) {
- JaxbType type = this.types.get(className);
- if (type.getKind() == jaxbTypeKind) {
- typesToUpdate.add(className);
- type.setDefaultMapped(defaultMapped);
- return;
- }
- else {
- this.removeType(className); // this will remove a type of another kind
- }
- }
-
- JaxbType type = buildType(resourceType);
- type.setDefaultMapped(defaultMapped);
- this.addType(type);
- }
-
- protected JaxbType.Kind calculateJaxbTypeKind(JavaResourceAbstractType resourceType) {
- if (resourceType.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- return JaxbType.Kind.ENUM;
- }
- // else is of kind TYPE
- else {
- return JaxbType.Kind.CLASS;
- }
- }
-
- protected JaxbType buildType(JavaResourceAbstractType resourceType) {
- JaxbType.Kind kind = calculateJaxbTypeKind(resourceType);
- if (kind == JaxbType.Kind.ENUM) {
- return buildJaxbEnum((JavaResourceEnum) resourceType);
- }
- else {
- return buildJaxbClass((JavaResourceType) resourceType);
- }
- }
-
-
- // ***** AbstractJaxbNode overrides *****
-
- @Override
- public JaxbProject getJaxbProject() {
- return this.jaxbProject;
- }
-
- @Override
- public IResource getResource() {
- return this.getProject();
- }
-
- protected IProject getProject() {
- return this.jaxbProject.getProject();
- }
-
-
- // ***** packages *****
-
- public Iterable<JaxbPackage> getPackages() {
- return new LiveCloneIterable<JaxbPackage>(this.packages.values());
- }
-
- public int getPackagesSize() {
- return this.packages.size();
- }
-
- public JaxbPackage getPackage(String packageName) {
- for (JaxbPackage jaxbPackage : this.getPackages()) {
- if (StringTools.stringsAreEqual(jaxbPackage.getName(), packageName)) {
- return jaxbPackage;
- }
- }
- return null;
- }
-
- protected JaxbPackage addPackage(JaxbPackage contextPackage) {
- if (this.packages.containsKey(contextPackage.getName())) {
- throw new IllegalArgumentException("Package with that name already exists."); //$NON-NLS-1$
- }
- this.packages.put(contextPackage.getName(), contextPackage);
- fireItemAdded(PACKAGES_COLLECTION, contextPackage);
- return contextPackage;
- }
-
- protected void removePackage(JaxbPackage contextPackage) {
- this.removePackage(contextPackage.getName());
- }
-
- protected void removePackage(String packageName) {
- if (! this.packages.containsKey(packageName)) {
- throw new IllegalArgumentException("No package with that name exists."); //$NON-NLS-1$
- }
- JaxbPackage removedPackage = this.packages.remove(packageName);
- fireItemRemoved(PACKAGES_COLLECTION, removedPackage);
- }
-
- protected JaxbPackage buildPackage(String packageName) {
- return this.getFactory().buildPackage(this, packageName);
- }
-
- protected boolean isEmpty(JaxbPackage jaxbPackage) {
- return jaxbPackage.isEmpty();
- }
-
-
- // ***** types *****
-
- public Iterable<JaxbType> getTypes() {
- return new LiveCloneIterable<JaxbType>(this.types.values());
- }
-
- public int getTypesSize() {
- return this.types.size();
- }
-
- public JaxbType getType(String typeName) {
- return typeName == null ? null : this.types.get(typeName);
- }
-
- protected void addType_(JaxbType type) {
- this.types.put(type.getFullyQualifiedName(), type);
- }
-
- protected void addType(JaxbType type) {
- if (this.types.containsKey(type.getFullyQualifiedName())) {
- throw new IllegalArgumentException("Type with that name already exists."); //$NON-NLS-1$
- }
- addType_(type);
- fireItemAdded(TYPES_COLLECTION, type);
- }
-
- protected void removeType(JaxbType type) {
- removeType(type.getFullyQualifiedName());
- }
-
- protected void removeType(String typeName) {
- if (! this.types.containsKey(typeName)) {
- throw new IllegalArgumentException("No type with that name exists."); //$NON-NLS-1$
- }
- JaxbType removedType = this.types.remove(typeName);
- fireItemRemoved(TYPES_COLLECTION, removedType);
- }
-
- public Iterable<JaxbType> getTypes(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
- public Iterable<JaxbClass> getClasses() {
- return new SubIterableWrapper<JaxbType, JaxbClass>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.CLASS;
- }
- });
- }
-
- public Iterable<JaxbClass> getClasses(JaxbPackage jaxbPackage) {
- return new SubIterableWrapper<JaxbType, JaxbClass>(
- new FilteringIterable<JaxbType>(getTypes(jaxbPackage)) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.CLASS;
- }
- });
- }
-
- public Iterable<JaxbEnum> getEnums() {
- return new SubIterableWrapper<JaxbType, JaxbEnum>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.ENUM;
- }
- });
- }
-
- public Iterable<JaxbEnum> getEnums(JaxbPackage jaxbPackage) {
- return new SubIterableWrapper<JaxbType, JaxbEnum>(
- new FilteringIterable<JaxbType>(getTypes(jaxbPackage)) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.ENUM;
- }
- });
- }
-
-
- protected JaxbClass buildJaxbClass(JavaResourceType resourceType) {
- return this.getFactory().buildJaxbClass(this, resourceType);
- }
-
- protected JaxbEnum buildJaxbEnum(JavaResourceEnum resourceEnum) {
- return this.getFactory().buildJaxbEnum(this, resourceEnum);
- }
-
- public Iterable<XmlRegistry> getXmlRegistries(JaxbPackage jaxbPackage) {
- return new FilteringIterable<XmlRegistry>(
- new TransformationIterable<JaxbClass, XmlRegistry>(getClasses(jaxbPackage)) {
- @Override
- protected XmlRegistry transform(JaxbClass o) {
- return o.getXmlRegistry();
- }
- },
- NotNullFilter.INSTANCE);
- }
-
- public JaxbTypeMapping getTypeMapping(String typeName) {
- JaxbType type = getType(typeName);
- return (type == null) ? null : type.getMapping();
- }
-
- public JaxbClassMapping getClassMapping(String typeName) {
- JaxbType type = getType(typeName);
- return (type == null || (type.getKind() != JaxbType.Kind.CLASS)) ?
- null : ((JaxbClass) type).getMapping();
- }
-
-
- @Override
- public void stateChanged() {
- super.stateChanged();
- // forward to JAXB project
- this.jaxbProject.stateChanged();
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- for (JaxbPackage pkg : this.packages.values()) {
- pkg.validate(messages, reporter);
- }
- for (JaxbType type : this.types.values()) {
- type.validate(messages, reporter);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
deleted file mode 100644
index fe52fc03e0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-
-public class GenericContextRoot
- extends AbstractJaxbContextRoot {
-
- public GenericContextRoot(JaxbProject jaxbProject) {
- super(jaxbProject);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
deleted file mode 100644
index 5869fee34f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericPackage
- extends AbstractJaxbContextNode
- implements JaxbPackage {
-
- protected final String name;
-
- protected JaxbPackageInfo packageInfo;
-
-
- public GenericPackage(JaxbContextRoot parent, String name) {
- super(parent);
- this.name = name;
- JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
- if (jrp != null) {
- this.packageInfo = buildPackageInfo(jrp);
- }
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- if (this.packageInfo != null) {
- this.packageInfo.synchronizeWithResourceModel();
- }
- }
-
- //Building/removing of the packageInfo is in the update because this is dependent
- //on a JaxbFile being added/removed which only causes an update of the model.
- @Override
- public void update() {
- super.update();
- JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
- if (jrp == null) {
- this.setPackageInfo_(null);
- }
- else {
- if (this.packageInfo == null) {
- this.setPackageInfo_(this.buildPackageInfo(jrp));
- }
- else {
- this.packageInfo.update();
- }
- }
- }
-
-
- // **************** name **************************************************
-
- public String getName() {
- return this.name;
- }
-
-
- // **************** package info ******************************************
-
- public JaxbPackageInfo getPackageInfo() {
- return this.packageInfo;
- }
-
- protected void setPackageInfo_(JaxbPackageInfo packageInfo) {
- JaxbPackageInfo old = this.packageInfo;
- this.packageInfo = packageInfo;
- firePropertyChanged(PACKAGE_INFO_PROPERTY, old, this.packageInfo);
- }
-
- protected JaxbPackageInfo buildPackageInfo(JavaResourcePackage resourcePackage) {
- return getFactory().buildJavaPackageInfo(this, resourcePackage);
- }
-
- public boolean isEmpty() {
- return getPackageInfo() == null && getRegistry() == null;
- }
-
- public XmlRegistry getRegistry() {
- Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(this);
- if (CollectionTools.isEmpty(registries)) {
- return null;
- }
- return CollectionTools.get(registries, 0);
- }
-
-
- // **************** misc **************************************************
-
- public String getNamespace() {
- return (getPackageInfo() == null) ? "" : getPackageInfo().getXmlSchema().getNamespace();
- }
-
- public XmlNsForm getAttributeFormDefault() {
- return (getPackageInfo() == null) ? XmlNsForm.UNSET : getPackageInfo().getXmlSchema().getAttributeFormDefault();
- }
-
- public XmlNsForm getElementFormDefault() {
- return (getPackageInfo() == null) ? XmlNsForm.UNSET : getPackageInfo().getXmlSchema().getElementFormDefault();
- }
-
- public XsdSchema getXsdSchema() {
- return getJaxbProject().getSchemaLibrary().getSchema(getNamespace());
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
-
- if (getJaxbProject().getSchemaLibrary().getSchema(getNamespace()) == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.PACKAGE_NO_SCHEMA_FOR_NAMESPACE,
- new String[] {getNamespace(), this.name},
- this));
- }
-
- if (this.packageInfo != null) {
- this.packageInfo.validate(messages, reporter);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
deleted file mode 100644
index c918a9e0ad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class JaxbPackageAdapterFactory
- implements IAdapterFactory {
-
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JaxbPackage.class };
-
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IPackageFragment) {
- return getAdapter((IPackageFragment) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IPackageFragment packageFragment, Class<?> adapterType) {
- if (adapterType == JaxbPackage.class) {
- return getJaxbPackage(packageFragment);
- }
- return null;
- }
-
- private JaxbPackage getJaxbPackage(IPackageFragment packageFragment) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(packageFragment.getJavaProject().getProject());
- if (jaxbProject == null) {
- return null;
- }
- return jaxbProject.getContextRoot().getPackage(packageFragment.getElementName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java
deleted file mode 100644
index 348517bbb1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class JaxbPackageTester
- extends PropertyTester {
-
- public static final String HAS_PACKAGE_INFO = "hasPackageInfo"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof JaxbPackage) {
- return test((JaxbPackage) receiver, property, expectedValue);
- }
- return false;
- }
-
- private boolean test(JaxbPackage jaxbPackage, String property, Object expectedValue) {
- if (property.equals(HAS_PACKAGE_INFO)) {
- boolean hasPackageInfo = jaxbPackage.getJaxbProject().getJavaResourcePackage(jaxbPackage.getName()) != null;
- return Tools.valuesAreEqual(hasPackageInfo, expectedValue);
- }
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java
deleted file mode 100644
index 690bd62843..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptableMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaAdaptableAttributeMapping<A extends Annotation>
- extends AbstractJavaAttributeMapping<A>
- implements XmlAdaptableMapping {
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
-
- public AbstractJavaAdaptableAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlJavaTypeAdapter();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlJavaTypeAdapter();
- }
-
-
- // ***** XmlJavaTypeAdapter *****
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) getJavaResourceAttribute().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- XmlJavaTypeAdapter xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- setXmlJavaTypeAdapter_(null);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER) > 0) {
- return (XmlJavaTypeAdapterAnnotation) getJavaResourceAttribute().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- return null;
- }
-
- protected void initializeXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.synchronizeWithResourceModel();
- }
- else {
- setXmlJavaTypeAdapter_(buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.update();
- }
- }
-
-
- // ***** XmlAdapter *****
-
- public XmlAdapter getXmlAdapter() {
- // see if there is an xml adapter specified on this attribute
- if (this.xmlJavaTypeAdapter != null) {
- return this.xmlJavaTypeAdapter.getXmlAdapter();
- }
-
- String boundTypeName = getBoundTypeName();
-
- // see if there is an xml adapter specified on the type
- JaxbType boundType = getContextRoot().getType(boundTypeName);
- if (boundType != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = boundType.getXmlJavaTypeAdapter();
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
-
- // see if there is an xml adapter on the package
- JaxbPackage pkg = getJaxbClassMapping().getJaxbType().getJaxbPackage();
- JaxbPackageInfo pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = pkgInfo.getXmlJavaTypeAdapter(boundTypeName);
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
-
- // see if there is an xml adapter on the *type's* package
- JavaResourceAbstractType resourceType = getJaxbProject().getJavaResourceType(boundTypeName);
- if (resourceType != null) {
- pkg = getContextRoot().getPackage(resourceType.getPackageName());
- pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = pkgInfo.getXmlJavaTypeAdapter(boundTypeName);
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
- }
-
- return null;
- }
-
-
- // ***** misc *****
-
- @Override
- public String getValueTypeName() {
- XmlAdapter xmlAdapter = getXmlAdapter();
- return (xmlAdapter == null) ? super.getValueTypeName() : xmlAdapter.getValueType();
- }
-
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java
deleted file mode 100644
index 1539aec6dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-
-public abstract class AbstractJavaAttributeMapping<A extends Annotation>
- extends AbstractJavaContextNode
- implements JaxbAttributeMapping {
-
- protected boolean default_;
-
- protected AbstractJavaAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.default_ = this.buildDefault();
- }
-
-
- public JaxbClassMapping getClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncDefault();
- }
-
-
- // ********** annotation **********
-
- @SuppressWarnings("unchecked")
- public A getAnnotation() {
- return (A) getJavaResourceAttribute().getAnnotation(getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- /**
- * This method should only be called when an annotation *must* be present (such as when setting fields on it).
- * For most mappings, this is equivalent to #getAnnotation(), but for default mappings (such as @XmlElement)
- * an annotation will be added if none currently exists.
- */
- public A getOrCreateAnnotation() {
- A annotation = getAnnotation();
- if (annotation == null) {
- getPersistentAttribute().setMappingKey(getKey());
- annotation = getAnnotation();
- if (annotation == null) {
- throw new IllegalStateException("missing annotation: " + this); //$NON-NLS-1$
- }
- }
- return annotation;
- }
-
-
- // ********** default **********
-
- public boolean isDefault() {
- return this.default_;
- }
-
- protected void setDefault(boolean default_) {
- boolean old = this.default_;
- this.default_ = default_;
- this.firePropertyChanged(DEFAULT_PROPERTY, old, default_);
- }
-
- public void syncDefault() {
- this.setDefault(this.buildDefault());
- }
-
- protected boolean buildDefault() {
- return this.getAnnotation() == null;
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation() == null ? getJavaResourceAttribute().getNameTextRange(astRoot) : getAnnotation().getTextRange(astRoot);
- }
-
-
- // ********** misc **********
-
- public JaxbPersistentAttribute getPersistentAttribute() {
- return (JaxbPersistentAttribute) super.getParent();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getPersistentAttribute().getJavaResourceAttribute();
- }
-
- public String getBoundTypeName() {
- return getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public String getValueTypeName() {
- return getBoundTypeName();
- }
-
- public String getDataTypeName() {
- return getValueTypeName();
- }
-
- /**
- * Return the expected schema type associated with the data type
- */
- public XsdTypeDefinition getDataTypeXsdTypeDefinition() {
- String dataType = getDataTypeName();
- if (StringTools.stringIsEmpty(dataType)) {
- return null;
- }
-
- JaxbPackage pkg = getJaxbPackage();
- JaxbPackageInfo pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- for (XmlSchemaType schemaType : pkgInfo.getXmlSchemaTypes()) {
- if (dataType.equals(schemaType.getFullyQualifiedType())) {
- return schemaType.getXsdTypeDefinition();
- }
- }
- }
-
- JaxbTypeMapping jaxbTypeMapping = getContextRoot().getTypeMapping(dataType);
- if (jaxbTypeMapping != null) {
- return jaxbTypeMapping.getXsdTypeDefinition();
- }
-
- String builtInType = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(dataType);
- if (builtInType != null) {
- return XsdUtil.getSchemaForSchema().getTypeDefinition(builtInType);
- }
-
- return null;
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return new SingleElementIterable<String>(getValueTypeName());
- }
-
- /* default impl */
- public boolean isParticleMapping() {
- return false;
- }
-
- /* default impl */
- public boolean isTransient() {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
deleted file mode 100644
index 135d71ba06..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-
-public abstract class AbstractJavaAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- protected AbstractJavaAttributeMappingDefinition() {
- super();
- }
-
- /**
- * Default implementation. Override if the mapping definition needs to do more analysis.
- */
- public boolean isSpecified(JaxbPersistentAttribute persistentAttribute) {
- return persistentAttribute.getJavaResourceAttribute().getAnnotation(getAnnotationName())
- != null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
deleted file mode 100644
index bcf8327607..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaContextNode
- extends AbstractJaxbContextNode
- implements JavaContextNode {
-
- // **************** constructor *******************************************
-
- protected AbstractJavaContextNode(JaxbNode parent) {
- super(parent);
- }
-
-
- @Override
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
- // **************** content assist ****************************************
-
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- public abstract TextRange getValidationTextRange(CompilationUnit astRoot);
-
- /**
- * All subclass implementations {@link #validate(List, CompilationUnit))}
- * should be preceded by a "super" call to this method
- */
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java
deleted file mode 100644
index d3edefc11d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaElementQName
- extends AbstractJavaQName {
-
- public AbstractJavaElementQName(JavaContextNode parent, AbstractJavaQName.AnnotationProxy proxy) {
- super(parent, proxy);
- }
-
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- protected abstract JaxbPersistentAttribute getPersistentAttribute();
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- protected abstract XmlElementWrapper getElementWrapper();
-
- @Override
- public String getDefaultName() {
- return getPersistentAttribute().getJavaResourceAttribute().getName();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType == null) {
- return EmptyIterable.instance();
- }
-
- XmlElementWrapper elementWrapper = getElementWrapper();
-
- if (elementWrapper == null) {
- return xsdType.getElementNameProposals(getNamespace(), filter);
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement != null) {
- return xsdWrapperElement.getElementNameProposals(getNamespace(), filter);
- }
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage != null && jaxbPackage.getElementFormDefault() == XmlNsForm.QUALIFIED) ?
- getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType == null) {
- return;
- }
-
- XsdElementDeclaration resolvedXsdElement = null;
-
- XmlElementWrapper elementWrapper = getElementWrapper();
-
- if (elementWrapper == null) {
- resolvedXsdElement = xsdType.getElement(getNamespace(), getName());
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement == null) {
- // there will be a separate message for unresolved wrapper element
- // no need to also have a message for the nested element
- return;
- }
- resolvedXsdElement = xsdWrapperElement.getElement(getNamespace(), getName());
- }
-
- if (resolvedXsdElement == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
deleted file mode 100644
index 3412c96970..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaQName
- extends AbstractJavaContextNode
- implements JaxbQName {
-
- protected final AnnotationProxy proxy;
-
- protected String specifiedNamespace;
-
- protected String specifiedName;
-
-
- public AbstractJavaQName(JavaContextNode parent, AnnotationProxy proxy) {
- super(parent);
- this.proxy = proxy;
- this.specifiedNamespace = getAnnotationNamespace();
- this.specifiedName = getAnnotationName();
- }
-
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedNamespace_(getAnnotationNamespace());
- setSpecifiedName_(getAnnotationName());
- }
-
-
- protected abstract JaxbPackage getJaxbPackage();
-
- protected final XsdSchema getXsdSchema() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getXsdSchema();
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- if (StringTools.stringIsEmpty(getSpecifiedNamespace()) // namespace="" is actually interpreted as unspecified by JAXB tools
- || StringTools.stringsAreEqual(getSpecifiedNamespace(), JAXB.DEFAULT_STRING)) {
- return getDefaultNamespace();
- }
- return getSpecifiedNamespace();
- }
-
- public abstract String getDefaultNamespace();
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String newSpecifiedNamespace) {
- setAnnotationNamespace(newSpecifiedNamespace);
- setSpecifiedNamespace_(newSpecifiedNamespace);
- }
-
- protected void setSpecifiedNamespace_(String newSpecifiedNamespace) {
- String oldNamespace = this.specifiedNamespace;
- this.specifiedNamespace = newSpecifiedNamespace;
- firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, oldNamespace, newSpecifiedNamespace);
- }
-
- protected void setAnnotationNamespace(String newNamespace) {
- this.proxy.setNamespace(newNamespace);
- }
-
- protected String getAnnotationNamespace() {
- return this.proxy.getNamespace();
- }
-
-
- // ***** name *****
-
- public String getName() {
- if (getSpecifiedName() == null
- || StringTools.stringsAreEqual(getSpecifiedName(), JAXB.DEFAULT_STRING)) {
- return getDefaultName();
- }
- return getSpecifiedName();
- }
-
- public abstract String getDefaultName();
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- setAnnotationName(newSpecifiedName);
- setSpecifiedName_(newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String old = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, newSpecifiedName);
- }
-
- protected void setAnnotationName(String newName) {
- this.proxy.setName(newName);
- }
-
- protected String getAnnotationName() {
- return this.proxy.getName();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.proxy.namespaceTouches(pos, astRoot)) {
- return getNamespaceProposals(filter);
- }
-
- if (this.proxy.nameTouches(pos, astRoot)) {
- return getNameProposals(filter);
- }
-
- return EmptyIterable.instance();
- }
-
- protected abstract Iterable<String> getNamespaceProposals(Filter<String> filter);
-
- protected abstract Iterable<String> getNameProposals(Filter<String> filter);
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getParent().getValidationTextRange(astRoot);
- }
-
- protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) {
- return (textRange != null) ? textRange : getParent().getValidationTextRange(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNamespaceTextRange(astRoot), astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNameTextRange(astRoot), astRoot);
- }
-
- /**
- * e.g. "XML element"
- */
- protected String getReferencedComponentTypeDescription() {
- // default impl
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateName(messages, reporter, astRoot);
-
- if (! StringTools.stringIsEmpty(getName())) {
- validateReference(messages, reporter, astRoot);
- }
- }
-
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__MISSING_NAME,
- new String[] { getReferencedComponentTypeDescription() },
- this,
- getNameTextRange(astRoot)));
- }
- }
-
- protected abstract void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- protected IMessage getUnresolveSchemaComponentMessage(CompilationUnit astRoot) {
- return DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__UNRESOLVED_COMPONENT,
- new String[] { getReferencedComponentTypeDescription(), getNamespace(), getName() },
- this,
- getNameTextRange(astRoot));
- }
-
-
- public interface AnnotationProxy {
-
- String getNamespace();
-
- void setNamespace(String namespace);
-
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- String getName();
-
- void setName(String name);
-
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
- TextRange getNameTextRange(CompilationUnit astRoot);
- }
-
-
- /**
- * represents a {@link QNameAnnotation}
- */
- public static abstract class AbstractQNameAnnotationProxy
- implements AnnotationProxy {
-
- protected abstract QNameAnnotation getAnnotation(boolean createIfNull);
-
- public String getNamespace() {
- QNameAnnotation annotation = getAnnotation(false);
- return annotation == null ? null : annotation.getNamespace();
- }
-
- public void setNamespace(String newSpecifiedNamespace) {
- getAnnotation(true).setNamespace(newSpecifiedNamespace);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.namespaceTouches(pos, astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNamespaceTextRange(astRoot);
- }
-
- public String getName() {
- QNameAnnotation annotation = getAnnotation(false);
- return annotation == null ? null : annotation.getName();
- }
-
- public void setName(String newSpecifiedName) {
- getAnnotation(true).setName(newSpecifiedName);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.nameTouches(pos, astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNameTextRange(astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java
deleted file mode 100644
index 2b702eea08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaType
- extends AbstractJavaContextNode
- implements JaxbType {
-
- protected final JavaResourceAbstractType resourceType;
-
- protected JaxbTypeMapping mapping;
-
- protected boolean defaultMapped = false;
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
-
- protected AbstractJavaType(JaxbContextNode parent, JavaResourceAbstractType resourceType) {
- super(parent);
- this.resourceType = resourceType;
- initMapping();
- initXmlJavaTypeAdapter();
- }
-
-
- // ***** overrides *****
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncMapping();
- syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- updateMapping();
- updateXmlJavaTypeAdapter();
- }
-
-
- // ***** mapping *****
-
- public JaxbTypeMapping getMapping() {
- return this.mapping;
- }
-
- protected void setMapping_(JaxbTypeMapping newMapping) {
- JaxbTypeMapping old = this.mapping;
- this.mapping = newMapping;
- firePropertyChanged(MAPPING_PROPERTY, old, newMapping);
- }
-
- protected abstract JaxbTypeMapping buildMapping();
-
- protected void initMapping() {
- if (isDefaultMapped() || isSpecifiedMapped()) {
- this.mapping = buildMapping();
- }
- }
-
- protected void syncMapping() {
- if (this.mapping != null) {
- this.mapping.synchronizeWithResourceModel();
- }
- }
-
- protected void updateMapping() {
- boolean isMapped = isDefaultMapped() || isSpecifiedMapped();
- if (isMapped) {
- if (this.mapping != null) {
- this.mapping.update();
- }
- else {
- setMapping_(buildMapping());
- }
- }
- else if (this.mapping != null) {
- setMapping_(null);
- }
- }
-
- /*
- * Return true if the annotations on this type indicate it should have a mapping
- */
- protected boolean isSpecifiedMapped() {
- return getXmlTypeAnnotation() != null
- || getXmlRootElementAnnotation() != null
- || getXmlTransientAnnotation() != null;
- }
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TYPE);
- }
-
- protected XmlRootElementAnnotation getXmlRootElementAnnotation() {
- return (XmlRootElementAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT);
- }
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TRANSIENT);
- }
-
-
- // ***** default mapped *****
-
- public boolean isDefaultMapped() {
- return this.defaultMapped;
- }
-
- public void setDefaultMapped(boolean newValue) {
- boolean old = this.defaultMapped;
- this.defaultMapped = newValue;
- firePropertyChanged(DEFAULT_MAPPED_PROPERTY, old, newValue);
- }
-
-
- // ***** XmlJavaTypeAdapter *****
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation
- = (XmlJavaTypeAdapterAnnotation) getJavaResourceType().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- XmlJavaTypeAdapter xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- setXmlJavaTypeAdapter_(null);
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- if (getJavaResourceType().getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER) > 0) {
- return (XmlJavaTypeAdapterAnnotation) getJavaResourceType().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- return null;
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaTypeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void initXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.synchronizeWithResourceModel();
- }
- else {
- setXmlJavaTypeAdapter_(buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.update();
- }
- }
-
-
- // ***** JaxbType misc *****
-
- public JavaResourceAbstractType getJavaResourceType() {
- return this.resourceType;
- }
-
- public String getSimpleName() {
- return this.resourceType.getName();
- }
-
- public String getTypeQualifiedName() {
- String packageName = getPackageName();
- return (packageName.length() == 0) ? getFullyQualifiedName() : getFullyQualifiedName().substring(packageName.length() + 1);
- }
-
- public String getFullyQualifiedName() {
- return this.resourceType.getQualifiedName();
- }
-
- public String getPackageName() {
- return this.resourceType.getPackageName();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getContextRoot().getPackage(getPackageName());
- }
-
- public JaxbPackageInfo getJaxbPackageInfo() {
- JaxbPackage pkg = getJaxbPackage();
- return (pkg == null) ? null : pkg.getPackageInfo();
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- if (this.mapping != null) {
- return this.mapping.getReferencedXmlTypeNames();
- }
- return EmptyIterable.instance();
- }
-
-
- // ***** misc *****
-
- protected CompilationUnit buildASTRoot() {
- return this.resourceType.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.mapping != null) {
- result = this.mapping.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- if (this.xmlJavaTypeAdapter != null) {
- result = this.xmlJavaTypeAdapter.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- /**
- * Override as needed
- */
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJavaResourceType().getNameTextRange(astRoot);
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- // TODO temporary hack since we don't know yet where to put
- // any messages for types in another project
- IFile file = this.resourceType.getFile();
- // 'file' will be null if the type is "external" and binary;
- // the file will be in a different project if the type is "external" and source;
- // the type will be binary if it is in a JAR in the current project
- if ((file != null)
- && file.getProject().equals(getJaxbProject().getProject())
- && (this.resourceType instanceof SourceNode)) {
- // build the AST root here to pass down
- this.validate(messages, reporter, this.buildASTRoot());
- }
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.mapping != null) {
- this.mapping.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
deleted file mode 100644
index 37e03e20aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaTypeMapping
- extends AbstractJavaContextNode
- implements JaxbTypeMapping {
-
- protected boolean xmlTransient;
-
- protected final JaxbQName qName;
-
- protected XmlRootElement xmlRootElement;
-
- protected XmlSeeAlso xmlSeeAlso;
-
-
- protected AbstractJavaTypeMapping(JaxbType parent) {
- super(parent);
- initXmlTransient();
- this.qName = buildQName();
- initXmlRootElement();
- initializeXmlSeeAlso();
- }
-
-
- public JaxbType getJaxbType() {
- return (JaxbType) getParent();
- }
-
- protected JavaResourceAbstractType getJavaResourceType() {
- return getJaxbType().getJavaResourceType();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbType().getJaxbPackage();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlTransient();
- this.qName.synchronizeWithResourceModel();
- syncXmlRootElement();
- syncXmlSeeAlso();
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- updateXmlRootElement();
- updateXmlSeeAlso();
- }
-
-
- // ***** XmlTransient *****
-
- public boolean isXmlTransient() {
- return this.xmlTransient;
- }
-
- public void setXmlTransient(boolean newValue) {
- getJavaResourceType().addAnnotation(JAXB.XML_TRANSIENT);
- setXmlTransient_(newValue);
- }
-
- protected void setXmlTransient_(boolean newValue) {
- boolean old = this.xmlTransient;
- this.xmlTransient = newValue;
- firePropertyChanged(XML_TRANSIENT_PROPERTY, old, newValue);
- }
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TRANSIENT);
- }
-
- protected void initXmlTransient() {
- this.xmlTransient = getXmlTransientAnnotation() != null;
- }
-
- protected void syncXmlTransient() {
- setXmlTransient_(getXmlTransientAnnotation() != null);
- }
-
-
- // ***** XmlType.name and namespace *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlTypeQName(this);
- }
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_TYPE);
- }
-
-
- // ***** XmlRootElement *****
-
- public XmlRootElement getXmlRootElement() {
- return this.xmlRootElement;
- }
-
- protected void setXmlRootElement_(XmlRootElement rootElement) {
- XmlRootElement old = this.xmlRootElement;
- this.xmlRootElement = rootElement;
- this.firePropertyChanged(XML_ROOT_ELEMENT_PROPERTY, old, rootElement);
- }
-
- public XmlRootElement addXmlRootElement() {
- if (this.xmlRootElement != null) {
- throw new IllegalStateException();
- }
-
- XmlRootElementAnnotation annotation
- = (XmlRootElementAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_ROOT_ELEMENT);
-
- XmlRootElement xmlRootElement = buildXmlRootElement(annotation);
- setXmlRootElement_(xmlRootElement);
- return xmlRootElement;
- }
-
- public void removeXmlRootElement() {
- if (this.xmlRootElement == null) {
- throw new IllegalStateException();
- }
-
- getJavaResourceType().removeAnnotation(JAXB.XML_ROOT_ELEMENT);
- setXmlRootElement_(null);
- }
-
- protected XmlRootElementAnnotation getXmlRootElementAnnotation() {
- return (XmlRootElementAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT);
- }
-
- protected XmlRootElement buildXmlRootElement() {
- XmlRootElementAnnotation annotation = getXmlRootElementAnnotation();
- return annotation == null ? null : buildXmlRootElement(annotation);
- }
-
- protected XmlRootElement buildXmlRootElement(XmlRootElementAnnotation resourceRootElement) {
- return getFactory().buildJavaXmlRootElement(this, resourceRootElement);
- }
-
- protected void initXmlRootElement() {
- this.xmlRootElement = this.buildXmlRootElement();
- }
-
- protected void syncXmlRootElement() {
- XmlRootElementAnnotation annotation = getXmlRootElementAnnotation();
- if (annotation != null) {
- if (this.xmlRootElement != null) {
- this.xmlRootElement.synchronizeWithResourceModel();
- }
- else {
- setXmlRootElement_(buildXmlRootElement(annotation));
- }
- }
- else if (this.xmlRootElement != null) {
- setXmlRootElement_(null);
- }
- }
-
- protected void updateXmlRootElement() {
- if (this.xmlRootElement != null) {
- this.xmlRootElement.update();
- }
- }
-
-
- // ***** XmlSeeAlso *****
-
- public XmlSeeAlso getXmlSeeAlso() {
- return this.xmlSeeAlso;
- }
-
- protected void setXmlSeeAlso_(XmlSeeAlso xmlSeeAlso) {
- XmlSeeAlso old = this.xmlSeeAlso;
- this.xmlSeeAlso = xmlSeeAlso;
- firePropertyChanged(XML_SEE_ALSO_PROPERTY, old, xmlSeeAlso);
- }
-
- public XmlSeeAlso addXmlSeeAlso() {
- if (this.xmlSeeAlso != null) {
- throw new IllegalStateException();
- }
- XmlSeeAlsoAnnotation annotation
- = (XmlSeeAlsoAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_SEE_ALSO);
-
- XmlSeeAlso xmlSeeAlso = buildXmlSeeAlso(annotation);
- setXmlSeeAlso_(xmlSeeAlso);
- return xmlSeeAlso;
- }
-
- public void removeXmlSeeAlso() {
- if (this.xmlSeeAlso == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(JAXB.XML_SEE_ALSO);
- setXmlSeeAlso_(null);
- }
-
- protected XmlSeeAlsoAnnotation getXmlSeeAlsoAnnotation() {
- return (XmlSeeAlsoAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_SEE_ALSO);
- }
-
- protected XmlSeeAlso buildXmlSeeAlso(XmlSeeAlsoAnnotation annotation) {
- return new GenericJavaXmlSeeAlso(this, annotation);
- }
-
- protected void initializeXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- this.xmlSeeAlso = (annotation == null) ?
- null
- : buildXmlSeeAlso(annotation);
- }
-
- protected void syncXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- if (annotation != null) {
- if (this.xmlSeeAlso != null) {
- this.xmlSeeAlso.synchronizeWithResourceModel();
- }
- else {
- setXmlSeeAlso_(buildXmlSeeAlso(annotation));
- }
- }
- else {
- setXmlSeeAlso_(null);
- }
- }
-
- protected void updateXmlSeeAlso() {
- if (this.xmlSeeAlso != null) {
- this.xmlSeeAlso.update();
- }
- }
-
-
- // ***** misc *****
-
- public final Iterable<String> getReferencedXmlTypeNames() {
- return (this.xmlTransient) ?
- getTransientReferencedXmlTypeNames()
- : getNonTransientReferencedXmlTypeNames();
- }
-
- protected Iterable<String> getTransientReferencedXmlTypeNames() {
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- if (this.xmlSeeAlso != null) {
- return this.xmlSeeAlso.getReferencedXmlTypeNames();
- }
- return EmptyIterable.instance();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- JaxbPackage jaxbPackage = getJaxbPackage();
- if (jaxbPackage != null) {
- getJaxbProject().getSchemaLibrary().refreshSchema(jaxbPackage.getNamespace());
- }
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlRootElement != null) {
- result = this.xmlRootElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getXmlTypeAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : getJaxbType().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! this.xmlTransient) {
- this.qName.validate(messages, reporter, astRoot);
-
- if (this.xmlRootElement != null) {
- this.xmlRootElement.validate(messages, reporter, astRoot);
- }
- }
- }
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition() {
- JaxbPackage jaxbPackage = getJaxbPackage();
- XsdSchema xsdSchema = (jaxbPackage == null) ? null : jaxbPackage.getXsdSchema();
- if (xsdSchema == null) {
- return null;
- }
-
- if (! StringTools.stringIsEmpty(this.qName.getName())) {
- return xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName());
- }
-
- if (this.xmlRootElement != null) {
- XsdElementDeclaration xsdElement
- = xsdSchema.getElementDeclaration(
- this.xmlRootElement.getQName().getNamespace(),
- this.xmlRootElement.getQName().getName());
- if (xsdElement != null) {
- return xsdElement.getType();
- }
- }
-
- return null;
- }
-
- public boolean hasRootElementInHierarchy() {
- return this.xmlRootElement != null;
- }
-
-
- protected class XmlTypeQName
- extends AbstractJavaQName {
-
- protected XmlTypeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage();
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public String getDefaultName() {
- return Introspector.decapitalize(AbstractJavaTypeMapping.this.getJaxbType().getSimpleName());
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getTypeNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_TYPE_DESC;
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // do not call super... - it is not an error if the name is ""
- // if name is absent (""), namespace cannot be different from package namespace
- if ("".equals(getName())
- && ! StringTools.stringsAreEqual(
- getNamespace(),
- getDefaultNamespace())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE,
- this,
- getXmlTypeAnnotation().getNamespaceTextRange(astRoot)));
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // if name is not absent (""), type must be from schema associated with this package
- String name = getName();
- String namespace = getNamespace();
-
- if (! StringTools.stringIsEmpty(name)) {
- XsdSchema schema = this.getXsdSchema();
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return AbstractJavaTypeMapping.this.getXmlTypeAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
deleted file mode 100644
index f2c8bb9d3a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public abstract class AbstractJavaXmlJavaTypeAdapter
- extends AbstractJavaContextNode
- implements XmlJavaTypeAdapter {
-
- protected final XmlJavaTypeAdapterAnnotation annotation;
-
- protected String value;
-
- protected XmlAdapter xmlAdapter;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- protected AbstractJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.value = getResourceValue();
- initializeXmlAdapter();
- this.specifiedType = getResourceTypeString();
- this.defaultType = buildDefaultType();
- }
-
-
- public XmlJavaTypeAdapterAnnotation getAnnotation() {
- return this.annotation;
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setValue_(getResourceValue());
- syncXmlAdapter();
- setSpecifiedType_(getResourceTypeString());
- setDefaultType(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlAdapter();
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- this.annotation.setValue(value);
- this.setValue_(value);
- }
-
- protected void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- protected String getResourceValue() {
- return this.annotation.getValue();
- }
-
- public String getFullyQualifiedValue() {
- return this.annotation.getFullyQualifiedValue();
- }
-
-
- // ***** xmlAdapter *****
-
- public XmlAdapter getXmlAdapter() {
- return this.xmlAdapter;
- }
-
- protected void setXmlAdapter_(XmlAdapter xmlAdapter) {
- XmlAdapter old = this.xmlAdapter;
- this.xmlAdapter = xmlAdapter;
- firePropertyChanged(XML_ADAPTER_PROPERTY, old, xmlAdapter);
- }
-
- protected JavaResourceType getXmlAdapterResourceType() {
- String xmlAdapterName = getFullyQualifiedValue();
- return (JavaResourceType) getJaxbProject().getJavaResourceType(xmlAdapterName, JavaResourceAbstractType.Kind.TYPE);
- }
-
- protected XmlAdapter buildXmlAdapter(JavaResourceType xmlAdapterResourceType) {
- return new GenericJavaXmlAdapter(this, xmlAdapterResourceType);
- }
-
- protected void initializeXmlAdapter() {
- JavaResourceType xmlAdapterResourceType = getXmlAdapterResourceType();
- if (xmlAdapterResourceType != null) {
- this.xmlAdapter = buildXmlAdapter(xmlAdapterResourceType);
- }
- }
-
- protected void syncXmlAdapter() {
- if (this.xmlAdapter != null) {
- this.xmlAdapter.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlAdapter() {
- JavaResourceType newResourceType = getXmlAdapterResourceType();
- if (newResourceType == null) {
- setXmlAdapter_(null);
- }
- else {
- if (this.xmlAdapter == null) {
- setXmlAdapter_(buildXmlAdapter(newResourceType));
- }
- else {
- JavaResourceType currentResourceType = this.xmlAdapter.getJavaResourceType();
- if (currentResourceType == null || ! currentResourceType.equals(newResourceType)) {
- setXmlAdapter_(buildXmlAdapter(newResourceType));
- }
- else {
- this.xmlAdapter.update();
- }
- }
- }
- }
-
-
- // ***** type *****
-
- public String getType() {
- return this.specifiedTypeNotSet() ? this.getDefaultType() : this.getSpecifiedType();
- }
-
- /**
- * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT
- */
- protected boolean specifiedTypeNotSet() {
- return getSpecifiedType() == null || this.annotation.getFullyQualifiedType().equals(DEFAULT_TYPE);
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(String defaultType) {
- String oldDefaultType = this.defaultType;
- this.defaultType = defaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, defaultType);
- }
-
- protected abstract String buildDefaultType();
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String location) {
- this.annotation.setType(location);
- this.setSpecifiedType_(location);
- }
-
- protected void setSpecifiedType_(String type) {
- String old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected String getResourceTypeString() {
- return this.annotation.getType();
- }
-
- public String getFullyQualifiedType() {
- return specifiedTypeNotSet() ? getDefaultType() : this.annotation.getFullyQualifiedType();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java
deleted file mode 100644
index 57c51ad727..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttachmentRef;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JaxbBasicSchemaComponentAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaXmlNamedNodeMapping<A extends JaxbBasicSchemaComponentAnnotation>
- extends AbstractJavaXmlNodeMapping<A>
- implements XmlNamedNodeMapping {
-
- protected XmlID xmlID;
-
- protected XmlIDREF xmlIDREF;
-
- protected XmlAttachmentRef xmlAttachmentRef;
-
-
- public AbstractJavaXmlNamedNodeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlID();
- initializeXmlIDREF();
- initializeXmlAttachmentRef();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlID();
- syncXmlIDREF();
- syncXmlAttachmentRef();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlID();
- updateXmlIDREF();
- updateXmlAttachmentRef();
- }
-
-
- // ***** XmlID *****
-
- public XmlID getXmlID() {
- return this.xmlID;
- }
-
- public XmlID addXmlID() {
- if (this.xmlID != null) {
- throw new IllegalStateException();
- }
- XmlIDAnnotation annotation = (XmlIDAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ID);
-
- XmlID xmlID = this.buildXmlID(annotation);
- this.setXmlID_(xmlID);
- return xmlID;
- }
-
- protected XmlID buildXmlID(XmlIDAnnotation xmlIDAnnotation) {
- return new GenericJavaXmlID(this, xmlIDAnnotation);
- }
-
- public void removeXmlID() {
- if (this.xmlID == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ID);
- this.setXmlID_(null);
- }
-
- protected void initializeXmlID() {
- XmlIDAnnotation annotation = this.getXmlIDAnnotation();
- if (annotation != null) {
- this.xmlID = this.buildXmlID(annotation);
- }
- }
-
- protected XmlIDAnnotation getXmlIDAnnotation() {
- return (XmlIDAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ID);
- }
-
- protected void syncXmlID() {
- XmlIDAnnotation annotation = this.getXmlIDAnnotation();
- if (annotation != null) {
- if (this.getXmlID() != null) {
- this.getXmlID().synchronizeWithResourceModel();
- }
- else {
- this.setXmlID_(this.buildXmlID(annotation));
- }
- }
- else {
- this.setXmlID_(null);
- }
- }
-
- protected void updateXmlID() {
- if (this.getXmlID() != null) {
- this.getXmlID().update();
- }
- }
-
- protected void setXmlID_(XmlID xmlID) {
- XmlID oldXmlID = this.xmlID;
- this.xmlID = xmlID;
- firePropertyChanged(XML_ID_PROPERTY, oldXmlID, xmlID);
- }
-
-
- //************ XmlIDREF ***************
-
- public XmlIDREF getXmlIDREF() {
- return this.xmlIDREF;
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
-
- getJavaResourceAttribute().addAnnotation(JAXB.XML_IDREF);
-
- XmlIDREF xmlIDREF = buildXmlIDREF();
- setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_IDREF);
- setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- if (getXmlIDREFAnnotation() != null) {
- this.xmlIDREF = buildXmlIDREF();
- }
- }
-
- protected void syncXmlIDREF() {
- if (getXmlIDREFAnnotation() == null) {
- setXmlIDREF_(null);
- }
- else if (this.xmlIDREF == null) {
- setXmlIDREF_(buildXmlIDREF());
- }
- else {
- this.xmlIDREF.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.xmlIDREF != null) {
- this.xmlIDREF.update();
- }
- }
-
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_IDREF);
- }
-
- protected XmlIDREF buildXmlIDREF() {
- return new GenericJavaXmlIDREF(this, buildXmlIDREFContext());
- }
-
- protected abstract GenericJavaXmlIDREF.Context buildXmlIDREFContext();
-
-
- //************ XmlAttachmentRef ***************
-
- public XmlAttachmentRef getXmlAttachmentRef() {
- return this.xmlAttachmentRef;
- }
-
- public XmlAttachmentRef addXmlAttachmentRef() {
- if (this.xmlAttachmentRef != null) {
- throw new IllegalStateException();
- }
- XmlAttachmentRefAnnotation annotation = (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ATTACHMENT_REF);
-
- XmlAttachmentRef xmlAttachmentRef = this.buildXmlAttachmentRef(annotation);
- this.setXmlAttachmentRef_(xmlAttachmentRef);
- return xmlAttachmentRef;
- }
-
- protected XmlAttachmentRef buildXmlAttachmentRef(XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation) {
- return new GenericJavaXmlAttachmentRef(this, xmlAttachmentRefAnnotation);
- }
-
- public void removeXmlAttachmentRef() {
- if (this.xmlAttachmentRef == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ATTACHMENT_REF);
- this.setXmlAttachmentRef_(null);
- }
-
- protected void initializeXmlAttachmentRef() {
- XmlAttachmentRefAnnotation annotation = this.getXmlAttachmentRefAnnotation();
- if (annotation != null) {
- this.xmlAttachmentRef = this.buildXmlAttachmentRef(annotation);
- }
- }
-
- protected XmlAttachmentRefAnnotation getXmlAttachmentRefAnnotation() {
- return (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- protected void syncXmlAttachmentRef() {
- XmlAttachmentRefAnnotation annotation = this.getXmlAttachmentRefAnnotation();
- if (annotation != null) {
- if (this.getXmlAttachmentRef() != null) {
- this.getXmlAttachmentRef().synchronizeWithResourceModel();
- }
- else {
- this.setXmlAttachmentRef_(this.buildXmlAttachmentRef(annotation));
- }
- }
- else {
- this.setXmlAttachmentRef_(null);
- }
- }
-
- protected void updateXmlAttachmentRef() {
- if (this.getXmlAttachmentRef() != null) {
- this.getXmlAttachmentRef().update();
- }
- }
-
- protected void setXmlAttachmentRef_(XmlAttachmentRef xmlAttachmentRef) {
- XmlAttachmentRef oldXmlAttachmentRef = this.xmlAttachmentRef;
- this.xmlAttachmentRef = xmlAttachmentRef;
- firePropertyChanged(XML_ATTACHMENT_REF_PROPERTY, oldXmlAttachmentRef, xmlAttachmentRef);
- }
-
-
- // ***** misc *****
-
- @Override
- public String getDataTypeName() {
- if (this.xmlIDREF != null) {
- JaxbClassMapping referenceMapping = getContextRoot().getClassMapping(getValueTypeName());
- if (referenceMapping != null) {
- JaxbAttributeMapping idMapping = referenceMapping.getXmlIdMapping();
- if (idMapping != null) {
- return idMapping.getValueTypeName();
- }
- }
- return String.class.getName();
- }
- return getValueTypeName();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlID != null) {
- this.xmlID.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlIDREF != null) {
- this.xmlIDREF.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlAttachmentRef != null) {
- this.xmlAttachmentRef.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected abstract class XmlIDREFContext
- implements GenericJavaXmlIDREF.Context {
-
- public XmlIDREFAnnotation getAnnotation() {
- return AbstractJavaXmlNamedNodeMapping.this.getXmlIDREFAnnotation();
- }
-
- public boolean isList() {
- return AbstractJavaXmlNamedNodeMapping.this.isXmlList();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java
deleted file mode 100644
index 8f5f0ca876..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java
+++ /dev/null
@@ -1,268 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlNodeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.XSDVariety;
-
-
-public abstract class AbstractJavaXmlNodeMapping<A extends Annotation>
- extends AbstractJavaAdaptableAttributeMapping<A>
- implements XmlNodeMapping {
-
- protected XmlSchemaType xmlSchemaType;
-
- protected boolean specifiedXmlList;
-
- protected boolean defaultXmlList;
-
-
- public AbstractJavaXmlNodeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlSchemaType();
- initializeXmlList();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlSchemaType();
- syncXmlList();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlSchemaType();
- }
-
-
- // ***** XmlSchemaType *****
-
- public XmlSchemaType getXmlSchemaType() {
- return this.xmlSchemaType;
- }
-
- protected void setXmlSchemaType_(XmlSchemaType xmlSchemaType) {
- XmlSchemaType oldXmlSchemaType = this.xmlSchemaType;
- this.xmlSchemaType = xmlSchemaType;
- this.firePropertyChanged(XML_SCHEMA_TYPE_PROPERTY, oldXmlSchemaType, xmlSchemaType);
- }
-
- public boolean hasXmlSchemaType() {
- return this.xmlSchemaType != null;
- }
-
- public XmlSchemaType addXmlSchemaType() {
- if (this.xmlSchemaType != null) {
- throw new IllegalStateException();
- }
- XmlSchemaTypeAnnotation annotation = (XmlSchemaTypeAnnotation) this.getJavaResourceAttribute().addAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- XmlSchemaType xmlJavaTypeAdapter = this.buildXmlSchemaType(annotation);
- this.setXmlSchemaType_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlSchemaType() {
- if (this.xmlSchemaType == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- this.setXmlSchemaType_(null);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation annotation) {
- return new GenericJavaAttributeMappingXmlSchemaType(this, annotation);
- }
-
- protected XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(JAXB.XML_SCHEMA_TYPE) > 0) {
- return (XmlSchemaTypeAnnotation) getJavaResourceAttribute().getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- }
- return null;
- }
-
- protected void initializeXmlSchemaType() {
- XmlSchemaTypeAnnotation annotation = this.getXmlSchemaTypeAnnotation();
- if (annotation != null) {
- this.xmlSchemaType = this.buildXmlSchemaType(annotation);
- }
- }
-
- protected void updateXmlSchemaType() {
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.update();
- }
- }
-
- protected void syncXmlSchemaType() {
- XmlSchemaTypeAnnotation annotation = this.getXmlSchemaTypeAnnotation();
- if (annotation != null) {
- if (this.getXmlSchemaType() != null) {
- this.getXmlSchemaType().synchronizeWithResourceModel();
- }
- else {
- this.setXmlSchemaType_(this.buildXmlSchemaType(annotation));
- }
- }
- else {
- this.setXmlSchemaType_(null);
- }
- }
-
-
- // ***** XmlList *****
-
- public boolean isXmlList() {
- return isSpecifiedXmlList() || isDefaultXmlList();
- }
-
- public boolean isSpecifiedXmlList() {
- return this.specifiedXmlList;
- }
-
- public void setSpecifiedXmlList(boolean newValue) {
- if (this.specifiedXmlList == newValue) {
- throw new IllegalStateException();
- }
-
- if (newValue) {
- getJavaResourceAttribute().addAnnotation(JAXB.XML_LIST);
- }
- else {
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_LIST);
- }
-
- setSpecifiedXmlList_(newValue);
- }
-
- protected void setSpecifiedXmlList_(boolean newValue) {
- boolean oldValue = this.specifiedXmlList;
- this.specifiedXmlList = newValue;
- firePropertyChanged(SPECIFIED_XML_LIST_PROPERTY, oldValue, newValue);
- }
-
- public boolean isDefaultXmlList() {
- return this.defaultXmlList;
- }
-
- protected void setDefaultXmlList_(boolean newValue) {
- boolean oldValue = this.defaultXmlList;
- this.defaultXmlList = newValue;
- firePropertyChanged(DEFAULT_XML_LIST_PROPERTY, oldValue, newValue);
- }
-
- protected void initializeXmlList() {
- this.specifiedXmlList = getXmlListAnnotation() != null;
- this.defaultXmlList = calculateDefaultXmlList();
- }
-
- protected void syncXmlList() {
- setSpecifiedXmlList_(getXmlListAnnotation() != null);
- setDefaultXmlList_(calculateDefaultXmlList());
- }
-
- protected XmlListAnnotation getXmlListAnnotation() {
- return (XmlListAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_LIST);
- }
-
- protected abstract boolean calculateDefaultXmlList();
-
-
- // ***** misc *****
-
- @Override
- public XsdTypeDefinition getDataTypeXsdTypeDefinition() {
- if (this.xmlSchemaType != null) {
- return this.xmlSchemaType.getXsdTypeDefinition();
- }
- return super.getDataTypeXsdTypeDefinition();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlSchemaType != null) {
- result = this.xmlSchemaType.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.validate(messages, reporter, astRoot);
- }
-
- if (isXmlList()) {
- validateXmlList(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlList(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE,
- this,
- getXmlListValidationTextRange(astRoot)));
- }
- else {
- XsdTypeDefinition xsdType = getDataTypeXsdTypeDefinition();
- if (xsdType != null
- && (xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE
- || ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().getVariety() == XSDVariety.LIST_LITERAL)) {
-
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE,
- new String[] { getValueTypeName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected TextRange getXmlListValidationTextRange(CompilationUnit astRoot) {
- XmlListAnnotation annotation = getXmlListAnnotation();
- return (annotation == null) ? getValidationTextRange(astRoot) : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java
deleted file mode 100644
index d351834091..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-public class FieldAccessor
- extends AbstractJavaContextNode
- implements Accessor {
-
- protected final JavaResourceField resourceField;
-
-
- public FieldAccessor(JaxbClassMapping parent, JavaResourceField resourceField) {
- super(parent);
- this.resourceField = resourceField;
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getResourceField();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- return AccessorTools.getBaseTypeName(this.getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- return AccessorTools.isCollectionType(getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return this.getJavaResourceAttribute().typeIsSubTypeOf(typeName);
- }
-
- public JavaResourceField getResourceField() {
- return this.resourceField;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return this.resourceField == resourceField;
- }
-
- public boolean isFor(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- return false;
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
deleted file mode 100644
index 8d98ffa589..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeMappingXmlSchemaType
- extends GenericJavaXmlSchemaType {
-
- public GenericJavaAttributeMappingXmlSchemaType(JaxbAttributeMapping parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return this.getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String fqType = getFullyQualifiedType();
- if (fqType != null && ! XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE,
- this,
- getTypeTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
deleted file mode 100644
index 8b1dd7cb09..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaAttributeXmlJavaTypeAdapter(JaxbAttributeMapping parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- // ********** type **********
-
- @Override
- protected String buildDefaultType() {
- return this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED,
- this,
- getAnnotation().getTypeTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
deleted file mode 100644
index 4d970adc56..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.lang.reflect.Modifier;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributesContainer
- extends AbstractJavaContextNode
- implements JaxbAttributesContainer {
-
- protected JavaResourceType javaResourceType;
-
- protected Owner owner;
-
- protected final Vector<JaxbPersistentAttribute> attributes = new Vector<JaxbPersistentAttribute>();
-
- public GenericJavaAttributesContainer(JaxbClassMapping parent, Owner owner, JavaResourceType resourceType) {
- super(parent);
- this.javaResourceType = resourceType;
- this.owner = owner;
- this.initializeAttributes();
- }
-
-
- public JaxbClassMapping getJaxbClassMapping() {
- return (JaxbClassMapping) getParent();
- }
-
- public boolean isFor(JavaResourceType javaResourceType) {
- return this.javaResourceType == javaResourceType;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.synchronizeNodesWithResourceModel(this.getAttributes());
- }
-
- @Override
- public void update() {
- super.update();
- this.updateAttributes();
- }
-
- // ********** access type **********
-
- protected XmlAccessType getAccessType() {
- return this.owner.getAccessType();
- }
-
-
- // ********** attributes **********
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return new LiveCloneIterable<JaxbPersistentAttribute>(this.attributes);
- }
-
- public int getAttributesSize() {
- return this.attributes.size();
- }
-
- protected void addAttribute(JaxbPersistentAttribute attribute) {
- if (this.attributes.add(attribute)) {
- this.owner.fireAttributeAdded(attribute);
- }
- }
-
- protected void removeAttribute(JaxbPersistentAttribute attribute) {
- if (this.attributes.remove(attribute)) {
- this.owner.fireAttributeRemoved(attribute);
- }
- }
-
- protected JaxbPersistentAttribute buildField(JavaResourceField resourceField) {
- return getFactory().buildJavaPersistentField(getJaxbClassMapping(), resourceField);
- }
-
- protected JaxbPersistentAttribute buildProperty(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return getFactory().buildJavaPersistentProperty(getJaxbClassMapping(), resourceGetter, resourceSetter);
- }
-
- protected void initializeAttributes() {
- if (getJaxbClassMapping().isXmlTransient()) {
- return;
- }
- if (getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
- this.initializePublicMemberAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.FIELD) {
- this.intializeFieldAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.PROPERTY) {
- this.intializePropertyAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.NONE) {
- this.intializeNoneAccessAttributes();
- }
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PUBLIC_MEMBER
- * 1. all public, non-static, non-transient fields (transient modifier, @XmlTransient is brought to the context model)
- * 2. all annotated fields that aren't public
- * 3. all public getter/setter javabeans pairs
- * 4. all annotated methods (some will have a matching getter/setter, some will be standalone)
- */
- private void initializePublicMemberAccessAttributes() {
- this.initializeFieldAttributes(PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER);
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all persistable resource method getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistablePublicMemberAccess(getterMethod, setterMethod)) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.FIELD
- * 1. all non-transient fields
- * 2. all annotated methods getters/setters
- */
- private void intializeFieldAccessAttributes() {
- this.initializeFieldAttributes(this.buildNonTransientNonStaticResourceFieldsFilter());
- this.initializeAnnotatedPropertyAttributes();
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PROPERTY
- * 1. all getter/setter javabeans pairs
- * 2. all annotated fields
- * 3. all annotated methods getters/setters that don't have a matching pair
- */
- private void intializePropertyAccessAttributes() {
- this.initializeFieldAttributes(ANNOTATED_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistableProperties(getterMethod, setterMethod)) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.NONE
- * 1. all annotated fields
- * 2. all annotated methods getters/setters (some will have a matching getter/setter, some will be standalone)
- */
- private void intializeNoneAccessAttributes() {
- this.initializeFieldAttributes(ANNOTATED_RESOURCE_FIELDS_FILTER);
- this.initializeAnnotatedPropertyAttributes();
- }
-
- private void initializeFieldAttributes(Filter<JavaResourceField> filter) {
- for (JavaResourceField resourceField : this.getResourceFields(filter)) {
- this.attributes.add(this.buildField(resourceField));
- }
- }
-
- private void initializeRemainingResourceMethodAttributes(Collection<JavaResourceMethod> resourceMethods) {
- //iterate through remaining resource methods and search for those that are annotated.
- //all getter methods will already be used.
- for (JavaResourceMethod resourceMethod : resourceMethods) {
- if (resourceMethod.isAnnotated()) {
- //annotated setter(or other random method) with no corresponding getter, bring into context model for validation purposes
- this.attributes.add(this.buildProperty(null, resourceMethod));
- }
- }
- }
-
- private static boolean methodsArePersistableProperties(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- if (setterMethod != null) {
- return true;
- }
- //Lists do not have to have a corresponding setter method
- else if (getterMethod.getTypeName().equals("java.util.List")) { //$NON-NLS-1$
- return true;
- }
- else if (getterMethod.isAnnotated()) {
- //annotated getter with no corresponding setter, bring into context model for validation purposes
- return true;
- }
- return false;
- }
-
- private static boolean methodsArePersistablePublicMemberAccess(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- if (getterMethod.isPublic()) {
- if (setterMethod != null) {
- if (setterMethod.isPublic()) {
- return true;
- }
- }
- //Lists do not have to have a corresponding setter method
- else if (getterMethod.getTypeName().equals("java.util.List")) { //$NON-NLS-1$
- return true;
- }
- else if (getterMethod.isAnnotated()) {
- //annotated getter with no corresponding setter, bring into context model for validation purposes
- return true;
- }
- }
- else if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- return true;
- }
- return false;
- }
-
- private void initializeAnnotatedPropertyAttributes() {
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- protected Iterable<JavaResourceField> getResourceFields() {
- return this.javaResourceType.getFields();
- }
-
- protected Iterable<JavaResourceMethod> getResourceMethods() {
- return this.javaResourceType.getMethods();
- }
-
- protected Iterable<JavaResourceField> getResourceFields(Filter<JavaResourceField> filter) {
- return new FilteringIterable<JavaResourceField>(getResourceFields(), filter);
- }
-
- protected Iterable<JavaResourceMethod> getResourceMethods(Filter<JavaResourceMethod> filter) {
- return new FilteringIterable<JavaResourceMethod>(getResourceMethods(), filter);
- }
-
- protected Filter<JavaResourceField> buildNonTransientNonStaticResourceFieldsFilter() {
- return new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return memberIsNonTransientNonStatic(resourceField) || resourceField.isAnnotated();
- }
- };
- }
-
- protected static Filter<JavaResourceField> PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER = new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return memberIsPublicNonTransientNonStatic(resourceField) || resourceField.isAnnotated();
- }
- };
-
- protected Filter<JavaResourceMethod> buildPersistablePropertyGetterMethodsFilter() {
- return new Filter<JavaResourceMethod>() {
- public boolean accept(JavaResourceMethod resourceMethod) {
- return methodIsPersistablePropertyGetter(resourceMethod, getResourceMethods());
- }
- };
- }
-
- protected static boolean memberIsPublicNonTransientNonStatic(JavaResourceMember resourceMember) {
- return resourceMember.isPublic() && memberIsNonTransientNonStatic(resourceMember);
- }
-
- protected static boolean memberIsNonTransientNonStatic(JavaResourceMember resourceMember) {
- return !resourceMember.isTransient() && !resourceMember.isStatic();
- }
-
- protected static Filter<JavaResourceField> ANNOTATED_RESOURCE_FIELDS_FILTER =
- new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return resourceField.isAnnotated();
- }
- };
-
- /**
- * The attributes are synchronized during the <em>update</em> because
- * the list of resource attributes is determined by the access type
- * which can be controlled in a number of different places....
- */
- protected void updateAttributes() {
- if (getJaxbClassMapping().isXmlTransient()) {
- for (JaxbPersistentAttribute contextAttribute : getAttributes()) {
- this.removeAttribute(contextAttribute);
- }
- return;
- }
- if (getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
- this.syncPublicMemberAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.FIELD) {
- this.syncFieldAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.PROPERTY) {
- this.syncPropertyAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.NONE) {
- this.syncNoneAccessAttributes();
- }
- }
-
- /**
- * Sync the attributes for XmlAccessType.PUBLIC_MEMBER
- * 1. all public, non-static, non-transient fields (transient modifier, @XmlTransient is brought to the context model)
- * 2. all annotated fields that aren't public
- * 3. all public getter/setter javabeans pairs
- * 4. all annotated methods (some will have a matching getter/setter, some will be standalone)
- */
- private void syncPublicMemberAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all persistable resource method getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistablePublicMemberAccess(getterMethod, setterMethod)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.FIELD
- * 1. all non-transient fields
- * 2. all annotated methods getters/setters
- */
- private void syncFieldAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, this.buildNonTransientNonStaticResourceFieldsFilter());
- this.syncAnnotatedPropertyAttributes(contextAttributes);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PROPERTY
- * 1. all getter/setter javabeans pairs
- * 2. all annotated fields
- * 3. all annotated methods getters/setters that don't have a matching pair
- */
- private void syncPropertyAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, ANNOTATED_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistableProperties(getterMethod, setterMethod)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.NONE
- * 1. all annotated fields
- * 2. all annotated methods getters/setters (some will have a matching getter/setter, some will be standalone)
- */
- private void syncNoneAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, ANNOTATED_RESOURCE_FIELDS_FILTER);
- this.syncAnnotatedPropertyAttributes(contextAttributes);
- }
-
- private void syncAnnotatedPropertyAttributes(HashSet<JaxbPersistentAttribute> contextAttributes) {
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- private void syncFieldAttributes(HashSet<JaxbPersistentAttribute> contextAttributes, Filter<JavaResourceField> filter) {
- for (JavaResourceField resourceField : this.getResourceFields(filter)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext(); ) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(resourceField)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- // added elements are sync'ed during construction or will be
- // updated during the next "update" (which is triggered by
- // their addition to the model)
- this.addAttribute(this.buildField(resourceField));
- }
- }
- }
-
- private void syncRemainingResourceMethods(HashSet<JaxbPersistentAttribute> contextAttributes, Collection<JavaResourceMethod> resourceMethods) {
- //iterate through remaining resource methods and search for those that are annotated.
- //all getter methods will already be used.
- for (JavaResourceMethod resourceMethod : resourceMethods) {
- if (resourceMethod.isAnnotated()) {
- boolean match = false;
- //annotated setter(or other random method) with no corresponding getter, bring into context model for validation purposes
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(null, resourceMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(null, resourceMethod));
- }
- }
- }
-
- // remove any leftover context attributes
- for (JaxbPersistentAttribute contextAttribute : contextAttributes) {
- this.removeAttribute(contextAttribute);
- }
- }
-
- /**
- * Return whether the specified method is a "getter" method that
- * represents a property that may be "persisted".
- */
- protected static boolean methodIsPersistablePropertyGetter(JavaResourceMethod resourceMethod, Iterable<JavaResourceMethod> allMethods) {
- if (methodHasInvalidModifiers(resourceMethod)) {
- return false;
- }
- if (resourceMethod.isConstructor()) {
- return false;
- }
-
- String returnTypeName = resourceMethod.getTypeName();
- if (returnTypeName == null) {
- return false; // DOM method bindings can have a null name
- }
- if (returnTypeName.equals("void")) { //$NON-NLS-1$
- return false;
- }
- if (methodHasParameters(resourceMethod)) {
- return false;
- }
-
- boolean booleanGetter = methodIsBooleanGetter(resourceMethod);
-
- // if the type has both methods:
- // boolean isProperty()
- // boolean getProperty()
- // then #isProperty() takes precedence and we ignore #getProperty();
- // but only having #getProperty() is OK too
- // (see the JavaBeans spec 1.01)
- if (booleanGetter && methodHasValidSiblingIsMethod(resourceMethod, allMethods)) {
- return false; // since the type also defines #isProperty(), ignore #getProperty()
- }
- return true;
- }
-
- private static boolean methodIsBooleanGetter(JavaResourceMethod resourceMethod) {
- String returnTypeName = resourceMethod.getTypeName();
- String name = resourceMethod.getMethodName();
- boolean booleanGetter = false;
- if (name.startsWith("is")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- } else {
- return false;
- }
- } else if (name.startsWith("get")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- booleanGetter = true;
- }
- } else {
- return false;
- }
- return booleanGetter;
- }
-
- /**
- * Return whether the method's modifiers prevent it
- * from being a getter or setter for a "persistent" property.
- */
- private static boolean methodHasInvalidModifiers(JavaResourceMethod resourceMethod) {
- int modifiers = resourceMethod.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return true;
- }
- return false;
- }
-
- private static boolean methodHasParameters(JavaResourceMethod resourceMethod) {
- return resourceMethod.getParametersSize() != 0;
- }
-
- /**
- * Return whether the method has a sibling "is" method for the specified
- * property and that method is valid for a "persistable" property.
- * Pre-condition: the method is a "boolean getter" (e.g. 'public boolean getProperty()');
- * this prevents us from returning true when the method itself is an
- * "is" method.
- */
- private static boolean methodHasValidSiblingIsMethod(JavaResourceMethod getMethod, Iterable<JavaResourceMethod> resourceMethods) {
- String capitalizedAttributeName = StringTools.capitalize(getMethod.getName());
- for (JavaResourceMethod sibling : resourceMethods) {
- if ((sibling.getParametersSize() == 0)
- && sibling.getMethodName().equals("is" + capitalizedAttributeName)) { //$NON-NLS-1$
- return methodIsValidSibling(sibling, "boolean"); //$NON-NLS-1$
- }
- }
- return false;
- }
-
- /**
- * Return whether the method has a sibling "set" method
- * and that method is valid for a "persistable" property.
- */
- private static JavaResourceMethod getValidSiblingSetMethod(JavaResourceMethod getMethod, Collection<JavaResourceMethod> resourceMethods) {
- String capitalizedSetAttributeName = "set" + StringTools.capitalize(getMethod.getName());//$NON-NLS-1$
- String parameterTypeErasureName = getMethod.getTypeName();
- for (JavaResourceMethod sibling : resourceMethods) {
- if ((sibling.getParametersSize() == 1)
- && sibling.getMethodName().equals(capitalizedSetAttributeName)
- && sibling.getParameterTypeName(0).equals(parameterTypeErasureName)) {
- return methodIsValidSibling(sibling, "void") ? sibling : null; //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * Return whether the specified method is a valid sibling with the
- * specified return type.
- */
- private static boolean methodIsValidSibling(JavaResourceMethod resourceMethod, String returnTypeName) {
- if (resourceMethod == null) {
- return false;
- }
- if (methodHasInvalidModifiers(resourceMethod)) {
- return false;
- }
- if (resourceMethod.isConstructor()) {
- return false;
- }
- String rtName = resourceMethod.getTypeName();
- if (rtName == null) {
- return false; // DOM method bindings can have a null name
- }
- return rtName.equals(returnTypeName);
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJaxbClassMapping().getValidationTextRange(astRoot);
- }
-
-
- interface Owner {
-
- /**
- * Return the access type of the owner, to be used in determining which attributes to build
- */
- XmlAccessType getAccessType();
-
- /**
- * fire property change event for the added attribute
- */
- void fireAttributeAdded(JaxbPersistentAttribute attribute);
-
- /**
- * fire property change event for the removed attribute
- */
- void fireAttributeRemoved(JaxbPersistentAttribute attribute);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
deleted file mode 100644
index f846e4d692..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.omg.CORBA.PUBLIC_MEMBER;
-
-
-public class GenericJavaClassMapping
- extends AbstractJavaTypeMapping
- implements JaxbClassMapping {
-
- protected String specifiedFactoryClass;
-
- protected String factoryMethod;
-
- protected final PropOrderContainer propOrderContainer;
-
- protected JaxbClassMapping superclass;
-
- protected XmlAccessType defaultAccessType;
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder defaultAccessOrder;
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected boolean hasRootElementInHierarchy_loaded = false;
- protected boolean hasRootElementInHierarchy = false;
-
- protected final JaxbAttributesContainer attributesContainer;
-
- protected final Map<JaxbClassMapping, JaxbAttributesContainer> includedAttributesContainers;
-
- public GenericJavaClassMapping(JaxbClass parent) {
- super(parent);
- this.includedAttributesContainers = new Hashtable<JaxbClassMapping, JaxbAttributesContainer>();
- this.propOrderContainer = new PropOrderContainer();
-
- initFactoryClass();
- initFactoryMethod();
- initPropOrder();
- initSpecifiedAccessType();
- initDefaultAccessType();
- initSpecifiedAccessOrder();
- initDefaultAccessOrder();
- this.attributesContainer = new GenericJavaAttributesContainer(this, buildAttributesContainerOwner(), getJavaResourceType());
- initIncludedAttributes();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- @Override
- public JaxbClass getJaxbType() {
- return (JaxbClass) super.getJaxbType();
- }
-
- public JaxbPackageInfo getPackageInfo() {
- JaxbPackage jaxbPackage = getJaxbPackage();
- // jaxb package may be null during initialization/update
- return (jaxbPackage == null) ? null : jaxbPackage.getPackageInfo();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncFactoryClass();
- syncFactoryMethod();
- syncPropOrder();
- syncSpecifiedAccessType();
- syncSpecifiedAccessOrder();
- this.attributesContainer.synchronizeWithResourceModel();
- syncIncludedAttributes();
- }
-
- @Override
- public void update() {
- super.update();
- updateSuperclass();
- updateDefaultAccessType();
- updateDefaultAccessOrder();
- this.hasRootElementInHierarchy_loaded = false; // triggers that the value must be recalculated on next request
- this.attributesContainer.update();
- updateIncludedAttributes();
- }
-
-
- // ***** factory class *****
-
- public String getFactoryClass() {
- return (this.specifiedFactoryClass != null) ? this.specifiedFactoryClass : JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS;
- }
-
- public String getSpecifiedFactoryClass() {
- return this.specifiedFactoryClass;
- }
-
- public void setSpecifiedFactoryClass(String factoryClass) {
- getXmlTypeAnnotation().setFactoryClass(factoryClass);
- setSpecifiedFactoryClass_(factoryClass);
- }
-
- protected void setSpecifiedFactoryClass_(String factoryClass) {
- String old = this.specifiedFactoryClass;
- this.specifiedFactoryClass = factoryClass;
- firePropertyChanged(SPECIFIED_FACTORY_CLASS_PROPERTY, old, factoryClass);
- }
-
- protected String getResourceFactoryClass() {
- return getXmlTypeAnnotation().getFactoryClass();
- }
-
- protected void initFactoryClass() {
- this.specifiedFactoryClass = getResourceFactoryClass();
- }
-
- protected void syncFactoryClass() {
- setSpecifiedFactoryClass_(getResourceFactoryClass());
- }
-
-
- // ***** factory method *****
-
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- getXmlTypeAnnotation().setFactoryMethod(factoryMethod);
- setFactoryMethod_(factoryMethod);
- }
-
- protected void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- protected String getResourceFactoryMethod() {
- return getXmlTypeAnnotation().getFactoryMethod();
- }
-
- protected void initFactoryMethod() {
- this.factoryMethod = getResourceFactoryMethod();
- }
-
- protected void syncFactoryMethod() {
- setFactoryMethod_(getResourceFactoryMethod());
- }
-
-
- // ***** prop order *****
-
- public ListIterable<String> getPropOrder() {
- return this.propOrderContainer.getContextElements();
- }
-
- public String getProp(int index) {
- return this.propOrderContainer.getContextElement(index);
- }
-
- public int getPropOrderSize() {
- return this.propOrderContainer.getContextElementsSize();
- }
-
- public void addProp(int index, String prop) {
- getXmlTypeAnnotation().addProp(index, prop);
- this.propOrderContainer.addContextElement(index, prop);
- }
-
- public void removeProp(String prop) {
- this.removeProp(this.propOrderContainer.indexOfContextElement(prop));
- }
-
- public void removeProp(int index) {
- this.getXmlTypeAnnotation().removeProp(index);
- this.propOrderContainer.removeContextElement(index);
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- this.getXmlTypeAnnotation().moveProp(targetIndex, sourceIndex);
- this.propOrderContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected void initPropOrder() {
- this.propOrderContainer.initialize();
- }
-
- protected void syncPropOrder() {
- this.propOrderContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<String> getResourcePropOrder() {
- ListIterable<String> result = getXmlTypeAnnotation().getPropOrder();
- if (CollectionTools.size(result) == 1 && StringTools.EMPTY_STRING.equals(CollectionTools.get(result, 0))) {
- return EmptyListIterable.instance();
- }
- return result;
- }
-
-
- // ***** XmlAccessorType *****
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.defaultAccessType;
- }
-
- public XmlAccessType getDefaultAccessType() {
- return this.defaultAccessType;
- }
-
- protected void setDefaultAccessType_(XmlAccessType access) {
- XmlAccessType old = this.defaultAccessType;
- this.defaultAccessType = access;
- firePropertyChanged(DEFAULT_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- public XmlAccessType getSpecifiedAccessType() {
- return this.specifiedAccessType;
- }
-
- public void setSpecifiedAccessType(XmlAccessType access) {
- getXmlAccessorTypeAnnotation().setValue(XmlAccessType.toJavaResourceModel(access));
- setSpecifiedAccessType_(access);
- }
-
- protected void setSpecifiedAccessType_(XmlAccessType access) {
- XmlAccessType old = this.specifiedAccessType;
- this.specifiedAccessType = access;
- firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- protected void initDefaultAccessType() {
- this.defaultAccessType = buildDefaultAccessType();
- }
-
- protected void updateDefaultAccessType() {
- setDefaultAccessType_(buildDefaultAccessType());
- }
-
- /**
- * Default access type is determined by the following, in order of precedence:
- * - @XmlAccessorType annotation on a mapped super class
- * - @XmlAccessorType annotation on the package
- * - default access type of {@link PUBLIC_MEMBER}
- */
- protected XmlAccessType buildDefaultAccessType() {
- XmlAccessType accessType = getSuperclassAccessType();
- if (accessType != null) {
- return accessType;
- }
- accessType = getPackageAccessType();
- if (accessType != null) {
- return accessType;
- }
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getSuperclassAccessType() {
- return this.superclass == null ? null : this.superclass.getSpecifiedAccessType();
- }
-
- protected XmlAccessType getPackageAccessType() {
- JaxbPackageInfo packageInfo = getPackageInfo();
- return (packageInfo == null) ? null : packageInfo.getAccessType();
- }
-
- protected XmlAccessorTypeAnnotation getXmlAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE);
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(getXmlAccessorTypeAnnotation().getValue());
- }
-
- protected void initSpecifiedAccessType() {
- this.specifiedAccessType = getResourceAccessType();
- }
-
- protected void syncSpecifiedAccessType() {
- setSpecifiedAccessType_(getResourceAccessType());
- }
-
-
- // ***** XmlAccessorOrder *****
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.defaultAccessOrder;
- }
-
- public XmlAccessOrder getDefaultAccessOrder() {
- return this.defaultAccessOrder;
- }
-
- protected void setDefaultAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.defaultAccessOrder;
- this.defaultAccessOrder = accessOrder;
- firePropertyChanged(DEFAULT_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- public XmlAccessOrder getSpecifiedAccessOrder() {
- return this.specifiedAccessOrder;
- }
-
- public void setSpecifiedAccessOrder(XmlAccessOrder accessOrder) {
- getXmlAccessorOrderAnnotation().setValue(XmlAccessOrder.toJavaResourceModel(accessOrder));
- setSpecifiedAccessOrder_(accessOrder);
- }
-
- protected void setSpecifiedAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.specifiedAccessOrder;
- this.specifiedAccessOrder = accessOrder;
- firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- protected void initDefaultAccessOrder() {
- this.defaultAccessOrder = buildDefaultAccessOrder();
- }
-
- protected void updateDefaultAccessOrder() {
- setDefaultAccessOrder_(buildDefaultAccessOrder());
- }
-
- /**
- * Default access order is determined by the following, in order of precedence:
- * - @XmlAccessorOrder annotation on a mapped super class
- * - @XmlAccessorOrder annotation on the package
- * - default access order of {@link UNDEFINED}
- */
- protected XmlAccessOrder buildDefaultAccessOrder() {
- XmlAccessOrder accessOrder = getSuperclassAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- accessOrder = getPackageAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getSuperclassAccessOrder() {
- JaxbClassMapping superclass = this.superclass;
- while (superclass != null) {
- XmlAccessOrder accessOrder = superclass.getSpecifiedAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- superclass = superclass.getSuperclass();
- }
- return null;
- }
-
- protected XmlAccessOrder getPackageAccessOrder() {
- JaxbPackageInfo packageInfo = getPackageInfo();
- return packageInfo == null ? null : packageInfo.getAccessOrder();
- }
-
- protected XmlAccessorOrderAnnotation getXmlAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER);
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(getXmlAccessorOrderAnnotation().getValue());
- }
-
- protected void initSpecifiedAccessOrder() {
- this.specifiedAccessOrder = getResourceAccessOrder();
- }
-
- protected void syncSpecifiedAccessOrder() {
- setSpecifiedAccessOrder_(getResourceAccessOrder());
- }
-
-
- // ********** super class **********
-
- public JaxbClassMapping getSuperclass() {
- return this.superclass;
- }
-
- protected void setSuperclass_(JaxbClassMapping superclass) {
- JaxbClassMapping old = this.superclass;
- this.superclass = superclass;
- this.firePropertyChanged(SUPERCLASS_PROPERTY, old, superclass);
- }
-
- protected void updateSuperclass() {
- setSuperclass_(findSuperclass());
- }
-
- protected JaxbClassMapping findSuperclass() {
- JavaResourceType resourceType = getSuperclass(getJavaResourceType());
- while (resourceType != null && resourceType != this) {
- JaxbType jaxbType = getJaxbProject().getContextRoot().getType(resourceType.getQualifiedName());
-
- // if the superclass is not a class, return null
- if (jaxbType == null || jaxbType.getKind() != JaxbType.Kind.CLASS) {
- return null;
- }
-
- JaxbClassMapping jaxbClassMapping = ((JaxbClass) jaxbType).getMapping();
- // rare for a non-null superclass to not be mapped, but potentially possible mid-update
- if (jaxbClassMapping != null) {
- return jaxbClassMapping;
- }
- else {
- resourceType = getSuperclass(resourceType);
- }
- }
- return null;
- }
-
- protected JavaResourceType getSuperclass(JavaResourceType resourceType) {
- String superclassName = resourceType.getSuperclassQualifiedName();
- if (superclassName == null) {
- return null;
- }
-
- return (JavaResourceType) getJaxbProject().getJavaResourceType(
- superclassName, JavaResourceType.Kind.TYPE);
- }
-
-
- // ***** attributes *****
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return this.attributesContainer.getAttributes();
- }
-
- public int getAttributesSize() {
- return this.attributesContainer.getAttributesSize();
- }
-
- protected GenericJavaAttributesContainer.Owner buildAttributesContainerOwner() {
- return new GenericJavaAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaClassMapping.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemAdded(ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemRemoved(ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ***** included attributes *****
-
- public Iterable<JaxbPersistentAttribute> getIncludedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(getIncludedAttributeSets());
- }
-
- protected Iterable<Iterable<JaxbPersistentAttribute>> getIncludedAttributeSets() {
- return new TransformationIterable<JaxbAttributesContainer, Iterable<JaxbPersistentAttribute>>(
- getIncludedAttributesContainers()) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbAttributesContainer attributesContainer) {
- return attributesContainer.getAttributes();
- }
- };
- }
-
- protected Iterable<JaxbAttributesContainer> getIncludedAttributesContainers() {
- return new LiveCloneIterable<JaxbAttributesContainer>(this.includedAttributesContainers.values()); // read-only
- }
-
- public int getIncludedAttributesSize() {
- int size = 0;
- for (JaxbAttributesContainer attributesContainer : getIncludedAttributesContainers()) {
- size += attributesContainer.getAttributesSize();
- }
- return size;
- }
-
- protected void initIncludedAttributes() {
- // xml transient classes have no included attributes
- if (isXmlTransient()) {
- return;
- }
- JaxbClassMapping superclass = this.superclass;
- // only add inherited attributes for superclasses up until a mapped class is encountered
- while (superclass != null && superclass.isXmlTransient()) {
- this.includedAttributesContainers.put(superclass, buildIncludedAttributesContainer(superclass));
- superclass = superclass.getSuperclass();
- }
- }
-
- protected void syncIncludedAttributes() {
- for (JaxbAttributesContainer attributesContainer : this.includedAttributesContainers.values()) {
- attributesContainer.synchronizeWithResourceModel();
- }
- }
-
- protected void updateIncludedAttributes() {
- HashSet<JaxbClassMapping> oldSuperclasses
- = CollectionTools.set(this.includedAttributesContainers.keySet());
- Set<JaxbPersistentAttribute> oldAttributes = CollectionTools.set(getIncludedAttributes());
-
- if (! isXmlTransient()) {
- JaxbClassMapping superclass = this.superclass;
- // only add inherited attributes for superclasses up until a mapped class is encountered
- while (superclass != null && superclass.isXmlTransient()) {
- if (this.includedAttributesContainers.containsKey(superclass)) {
- this.includedAttributesContainers.get(superclass).update();
- oldSuperclasses.remove(superclass);
- }
- else {
- this.includedAttributesContainers.put(superclass, buildIncludedAttributesContainer(superclass));
- }
- superclass = superclass.getSuperclass();
- }
- }
-
- for (JaxbClassMapping oldSuperclass : oldSuperclasses) {
- this.includedAttributesContainers.remove(oldSuperclass);
- }
-
- Set<JaxbPersistentAttribute> newAttributes = CollectionTools.set(getIncludedAttributes());
- if (CollectionTools.elementsAreDifferent(oldAttributes, newAttributes)) {
- fireCollectionChanged(INCLUDED_ATTRIBUTES_COLLECTION, newAttributes);
- }
- }
-
- protected JaxbAttributesContainer buildIncludedAttributesContainer(JaxbClassMapping jaxbClassMapping) {
- return new GenericJavaAttributesContainer(this, buildIncludedAttributesContainerOwner(), jaxbClassMapping.getJaxbType().getJavaResourceType());
- }
-
- protected GenericJavaAttributesContainer.Owner buildIncludedAttributesContainerOwner() {
- return new GenericJavaAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaClassMapping.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemAdded(INCLUDED_ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemRemoved(INCLUDED_ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ***** misc attributes *****
-
- public Iterable<JaxbPersistentAttribute> getAllLocallyDefinedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getAttributes(),
- getIncludedAttributes());
- }
-
- public Iterable<JaxbPersistentAttribute> getInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getIncludedAttributes(),
- getOtherInheritedAttributes());
- }
-
- public Iterable<JaxbPersistentAttribute> getAllAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getAttributes(),
- getIncludedAttributes(),
- getOtherInheritedAttributes());
- }
-
- /**
- * return those inherited attributes that are not included
- */
- protected Iterable<JaxbPersistentAttribute> getOtherInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- new TransformationIterable<JaxbClassMapping, Iterable<JaxbPersistentAttribute>>(
- new ChainIterable<JaxbClassMapping>(getSuperclass()) {
- @Override
- protected JaxbClassMapping nextLink(JaxbClassMapping currentLink) {
- return currentLink.getSuperclass();
- }
- }) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbClassMapping o) {
- return o.getAttributes();
- }
- });
- }
-
-
- // ***** subClasses *****
-
- @Override
- public boolean hasRootElementInHierarchy() {
- if (! this.hasRootElementInHierarchy_loaded) {
- this.hasRootElementInHierarchy = calculateHasRootElementInHierarchy();
- this.hasRootElementInHierarchy_loaded = true;
- }
- return this.hasRootElementInHierarchy;
- }
-
- protected boolean calculateHasRootElementInHierarchy() {
- if (this.getXmlRootElement() != null) {
- return true;
- }
-
- for (JaxbType jaxbType : getJaxbProject().getContextRoot().getTypes()) {
- if (jaxbType.getMapping() != null
- && ! jaxbType.getMapping().isXmlTransient()
- && jaxbType.getMapping().getXmlRootElement() != null
- && JDTTools.typeIsSubType(
- getJaxbProject().getJavaProject(),
- jaxbType.getFullyQualifiedName(), getJaxbType().getFullyQualifiedName())) {
- return true;
- }
- }
-
- return false;
- }
-
-
- // ***** misc *****
-
- @Override
- protected Iterable<String> getTransientReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()));
- }
-
- @Override
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getNonTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()),
- new CompositeIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, Iterable<String>>(getAttributes()) {
- @Override
- protected Iterable<String> transform(JaxbPersistentAttribute o) {
- return o.getMapping().getReferencedXmlTypeNames();
- }
- }));
- }
-
- public JaxbAttributeMapping getXmlIdMapping() {
- Iterator<XmlNamedNodeMapping> allXmlIdMappings =
- new FilteringIterable<XmlNamedNodeMapping>(
- new SubIterableWrapper<JaxbAttributeMapping, XmlNamedNodeMapping>(
- new FilteringIterable<JaxbAttributeMapping>(
- new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(getAllAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute o) {
- return o.getMapping();
- }
- }) {
- @Override
- protected boolean accept(JaxbAttributeMapping o) {
- return (o.getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY
- || o.getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- }
- })) {
- @Override
- protected boolean accept(XmlNamedNodeMapping o) {
- return o.getXmlID() != null;
- }
- }.iterator();
- return (allXmlIdMappings.hasNext()) ? allXmlIdMappings.next() : null;
- }
-
- protected Iterable<? extends JaxbAttributeMapping> getAttributeMappings() {
- return new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(getAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute attribute) {
- return attribute.getMapping();
- }
- };
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (propTouches(pos, astRoot)) {
- return getPropProposals(filter);
- }
-
- // TODO - factory methods?
-
- for (JaxbPersistentAttribute attribute : this.getAttributes()) {
- result = attribute.getJavaCompletionProposals(pos, filter, astRoot);
- if (!CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getPropProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, String>(getAllLocallyDefinedAttributes()) {
- @Override
- protected String transform(JaxbPersistentAttribute o) {
- return o.getName();
- }
- },
- filter));
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateConstructor(messages, reporter, astRoot);
- validatePropOrder(messages, reporter, astRoot);
- validateXmlAnyAttributeMapping(messages, astRoot);
- validateXmlAnyElementMapping(messages, astRoot);
- validateXmlValueMapping(messages, astRoot);
- validateXmlIDs(messages, astRoot);
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateConstructor(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // TODO - factory class/method
-
- if (! JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS.equals(getFactoryClass())) {
- if (StringTools.stringIsEmpty(getFactoryMethod())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__UNSPECIFIED_FACTORY_METHOD,
- this,
- getFactoryClassTextRange(astRoot)));
- }
- }
- else {
- if (getFactoryMethod() == null
- && getJaxbType().getXmlJavaTypeAdapter() == null
- && ! getJavaResourceType().hasPublicOrProtectedNoArgConstructor()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- }
-
- protected void validatePropOrder(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (CollectionTools.isEmpty(getPropOrder())) {
- return;
- }
-
- // no duplicates
- // all attributes/included attributes with XmlElement/s/Ref/s must be listed
- // no nonexistent attributes (attributes mapped otherwise allowed) ...
- // *except* no transient attributes allowed
-
- Bag<String> props = CollectionTools.bag(getPropOrder());
- Set<String> allAttributes = new HashSet<String>();
- Set<String> requiredAttributes = new HashSet<String>();
- Set<String> transientAttributes = new HashSet<String>();
-
- for (JaxbPersistentAttribute attribute : getAllLocallyDefinedAttributes()) {
- allAttributes.add(attribute.getName());
- transientAttributes.add(attribute.getName());
- }
-
- for (JaxbPersistentAttribute attribute : getAllLocallyDefinedAttributes()) {
- if (attribute.getMapping().isParticleMapping()) {
- requiredAttributes.add(attribute.getName());
- }
-
- if (! attribute.getMapping().isTransient()) {
- // remove transients (rather than previous algorithm of adding them)
- // there may be two attributes of the same name (one field, one property) in
- // a class, which is a correct configuration. we want to know if *every* attribute
- // of a given name is transient (or if there's a single non-transient attribute)
- transientAttributes.remove(attribute.getName());
- }
- }
-
- Set<Integer> duplicateProps = new HashSet<Integer>();
- Set<String> missingProps = new HashSet<String>(requiredAttributes);
- Set<Integer> nonexistentProps = new HashSet<Integer>();
- Set<Integer> transientProps = new HashSet<Integer>();
-
- for (int i = 0; i < getPropOrderSize(); i ++ ) {
- String prop = getProp(i);
-
- if (props.count(prop) > 1) {
- duplicateProps.add(i);
- }
-
- if (missingProps.contains(prop)) {
- missingProps.remove(prop);
- }
-
- if (! allAttributes.contains(prop)) {
- nonexistentProps.add(i);
- }
-
- if (transientAttributes.contains(prop)) {
- transientProps.add(i);
- }
- }
-
- for (int i : duplicateProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__DUPLICATE_PROP,
- new String[] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
-
- for (String missingProp : missingProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__MISSING_PROP,
- new String[] { missingProp },
- this,
- getPropOrderTextRange(astRoot)));
- }
-
- for (int i : nonexistentProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__NONEXISTENT_PROP,
- new String[] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
-
- for (int i : transientProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__TRANSIENT_PROP,
- new String [] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
- }
-
- protected void validateXmlAnyAttributeMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlAnyElementMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlValueMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlIDs(List<IMessage> messages, CompilationUnit astRoot) {
-
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if ((attribute.getMappingKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- || attribute.getMappingKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY)
- && ((XmlNamedNodeMapping) attribute.getMapping()).getXmlID() != null) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if ((attribute.getMappingKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- || attribute.getMappingKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY)
- && ((XmlNamedNodeMapping) attribute.getMapping()).getXmlID() != null) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getFactoryClassTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getFactoryMethodTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getPropOrderTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getXmlTypeAnnotation().getPropTextRange(index, astRoot);
- }
-
- protected boolean propTouches(int pos, CompilationUnit astRoot) {
- if (getXmlTypeAnnotation().propOrderTouches(pos, astRoot)) {
- for (int i = 0; i < getXmlTypeAnnotation().getPropOrderSize(); i ++ ) {
- if (getXmlTypeAnnotation().propTouches(i, pos, astRoot)) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- /**
- * xml prop order container
- */
- protected class PropOrderContainer
- extends ListContainer<String, String> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return PROP_ORDER_LIST;
- }
-
- @Override
- protected String buildContextElement(String resourceElement) {
- return resourceElement;
- }
-
- @Override
- protected ListIterable<String> getResourceElements() {
- return GenericJavaClassMapping.this.getResourcePropOrder();
- }
-
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
deleted file mode 100644
index 61e1c75034..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaElementFactoryMethod
- extends AbstractJavaContextNode
- implements JaxbElementFactoryMethod {
-
- protected final JavaResourceMethod resourceMethod;
-
- protected String scope;
-
- protected JaxbQName qName;
-
- protected JaxbQName substitutionHeadQName;
-
- protected String defaultValue;
-
-
- public GenericJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- super(parent);
- this.resourceMethod = resourceMethod;
- this.scope = getResourceScope();
- this.qName = buildQName();
- this.substitutionHeadQName = buildSubstitutionHeadQName();
- this.defaultValue = this.getResourceDefaultValue();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlElementDeclQName(this);
- }
-
- protected JaxbQName buildSubstitutionHeadQName() {
- return new XmlElementDeclSubstitutionHeadQName(this);
- }
-
- protected XmlRegistry getRegistry() {
- return (XmlRegistry) getParent();
- }
-
- public JavaResourceMethod getResourceMethod() {
- return this.resourceMethod;
- }
-
- protected XmlElementDeclAnnotation getXmlElementDeclAnnotation() {
- return (XmlElementDeclAnnotation) getResourceMethod().getAnnotation(JAXB.XML_ELEMENT_DECL);
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setScope_(getResourceScope());
- this.qName.synchronizeWithResourceModel();
- this.substitutionHeadQName.synchronizeWithResourceModel();
- setDefaultValue_(getResourceDefaultValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- this.substitutionHeadQName.update();
- }
-
-
- // ***** JaxbElementFactoryMethod impl *****
-
- public String getName() {
- return this.resourceMethod.getName();
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- protected void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- firePropertyChanged(SCOPE_PROPERTY, old, scope);
- }
-
- public void setScope(String scope) {
- getXmlElementDeclAnnotation().setScope(scope);
- setScope_(scope);
- }
-
- protected String getResourceScope() {
- return getXmlElementDeclAnnotation().getScope();
- }
-
- public String getFullyQualifiedScope() {
- return (this.scope == null) ? DEFAULT_SCOPE_CLASS_NAME : getXmlElementDeclAnnotation().getFullyQualifiedScopeClassName();
- }
-
- public boolean isGlobalScope() {
- return DEFAULT_SCOPE_CLASS_NAME.equals(getFullyQualifiedScope());
- }
-
-
- // ***** qname *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- // ***** substitution head qname *****
-
- public JaxbQName getSubstitutionHeadQName() {
- return this.substitutionHeadQName;
- }
-
-
- // ***** default value *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- public void setDefaultValue(String defaultValue) {
- getXmlElementDeclAnnotation().setDefaultValue(defaultValue);
- setDefaultValue_(defaultValue);
- }
-
- protected String getResourceDefaultValue() {
- return getXmlElementDeclAnnotation().getDefaultValue();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.substitutionHeadQName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlElementDeclAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- this.substitutionHeadQName.validate(messages, reporter, astRoot);
-
- JavaResourceMethod resourceMethod = getResourceMethod();
- validateMethodReturnType(resourceMethod, messages, astRoot);
-
- if (resourceMethod.getParametersSize() != 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected void validateMethodReturnType(
- JavaResourceMethod resourceMethod, List<IMessage> messages, CompilationUnit astRoot) {
-
- if (! JAXB.JAXB_ELEMENT.equals(resourceMethod.getTypeName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
-
- protected class XmlElementDeclQName
- extends AbstractJavaQName {
-
- protected XmlElementDeclQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaElementFactoryMethod.this.getRegistry().getJaxbClass().getJaxbPackage();
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType != null) {
- return xsdType.getElementNameProposals(getNamespace(), filter, true);
- }
- }
- }
-
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- return xsdSchema.getElementNameProposals(getNamespace(), filter);
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema xsdSchema = this.getXsdSchema();
- return (xsdSchema == null) ? EmptyIterable.<String>instance() : xsdSchema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType == null) {
- return;
- }
-
- if (xsdType.getElement(getNamespace(), getName(), true) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- else {
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaElementFactoryMethod.this.getXmlElementDeclAnnotation();
- }
- }
-
-
- protected class XmlElementDeclSubstitutionHeadQName
- extends AbstractJavaQName {
-
- protected XmlElementDeclSubstitutionHeadQName(JavaContextNode parent) {
- super(parent, new SubstitutionHeadQNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaElementFactoryMethod.this.getRegistry().getJaxbClass().getJaxbPackage();
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType != null) {
- return xsdType.getElementNameProposals(getNamespace(), filter);
- }
- }
-
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- return xsdSchema.getElementNameProposals(getNamespace(), filter);
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema xsdSchema = this.getXsdSchema();
- return (xsdSchema == null) ? EmptyIterable.<String>instance() : xsdSchema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.SUBSTITUTION_HEAD_DESC;
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // need to ignore the unspecified (null) case
- if ("".equals(getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__MISSING_NAME,
- new String[] { getReferencedComponentTypeDescription() },
- this,
- getNameTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(getName())) {
- if (Tools.valuesAreEqual(getName(), GenericJavaElementFactoryMethod.this.getQName().getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME,
- this,
- getNameTextRange(astRoot)));
- }
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
-
- for (JaxbElementFactoryMethod elementDecl : GenericJavaElementFactoryMethod.this.getRegistry().getElementFactoryMethods()) {
- if (Tools.valuesAreEqual(getName(), elementDecl.getSubstitutionHeadQName().getName())
- && Tools.valuesAreEqual(getNamespace(), elementDecl.getSubstitutionHeadQName().getNamespace())) {
- return;
- }
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL,
- new String[] { getNamespace(), getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
-
- protected class SubstitutionHeadQNameAnnotationProxy
- implements AbstractJavaQName.AnnotationProxy {
-
- protected XmlElementDeclAnnotation getAnnotation() {
- return GenericJavaElementFactoryMethod.this.getXmlElementDeclAnnotation();
- }
-
- public String getNamespace() {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return annotation == null ? null : annotation.getSubstitutionHeadNamespace();
- }
-
- public void setNamespace(String newSpecifiedNamespace) {
- getAnnotation().setSubstitutionHeadNamespace(newSpecifiedNamespace);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNamespaceTouches(pos, astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNamespaceTextRange(astRoot);
- }
-
- public String getName() {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return annotation == null ? null : annotation.getSubstitutionHeadName();
- }
-
- public void setName(String newSpecifiedName) {
- getAnnotation().setSubstitutionHeadName(newSpecifiedName);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNameTouches(pos, astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNameTextRange(astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
deleted file mode 100644
index 479ee45894..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaEnumConstant
- extends AbstractJavaContextNode
- implements JaxbEnumConstant {
-
- final protected JavaResourceEnumConstant resourceEnumConstant;
-
- protected String specifiedValue;
-
- public GenericJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant) {
- super(parent);
- this.resourceEnumConstant = resourceEnumConstant;
- this.specifiedValue = this.getResourceEnumValue();
- }
-
-
- protected JaxbEnumMapping getEnumMapping() {
- return (JaxbEnumMapping) getParent();
- }
-
- public JavaResourceEnumConstant getResourceEnumConstant() {
- return this.resourceEnumConstant;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedValue_(this.getResourceEnumValue());
- }
-
-
- // ********** xml enum value annotation **********
-
- protected XmlEnumValueAnnotation getXmlEnumValueAnnotation() {
- return (XmlEnumValueAnnotation) this.getResourceEnumConstant().getNonNullAnnotation(JAXB.XML_ENUM_VALUE);
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.resourceEnumConstant.getName();
- }
-
- // ********** value **********
-
- public String getValue() {
- return this.getSpecifiedValue() != null ? this.getSpecifiedValue() : this.getDefaultValue();
- }
-
- public String getDefaultValue() {
- return this.getName();
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String value) {
- this.getXmlEnumValueAnnotation().setValue(value);
- this.setSpecifiedValue_(value);
- }
-
- protected void setSpecifiedValue_(String value) {
- String old = this.specifiedValue;
- this.specifiedValue = value;
- this.firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, value);
- }
-
- protected String getResourceEnumValue() {
- return this.getXmlEnumValueAnnotation().getValue();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (valueTouches(pos, astRoot)) {
- XsdTypeDefinition<?> xsdType = getEnumMapping().getXsdTypeDefinition();
- if (xsdType != null && xsdType.getKind() == XsdTypeDefinition.Kind.SIMPLE) {
- XsdSimpleTypeDefinition xsdSimpleType = (XsdSimpleTypeDefinition) xsdType;
- return xsdSimpleType.getEnumValueProposals(filter);
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean valueTouches(int pos, CompilationUnit astRoot) {
- return getXmlEnumValueAnnotation().valueTouches(pos, astRoot);
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String value = getValue();
- XsdTypeDefinition<?> xsdType = getEnumMapping().getXsdTypeDefinition();
-
- if (xsdType == null || xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- return;
- }
-
- if (! ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().isValidLiteral(value)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ENUM_VALUE__INVALID_LEXICAL_VALUE,
- new String[] { value, xsdType.getName() },
- this,
- getValueTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceEnumConstant().getTextRange(astRoot);
- }
-
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
- TextRange enumValueTextRange = getXmlEnumValueAnnotation().getValueTextRange(astRoot);
- return enumValueTextRange != null ? enumValueTextRange : getValidationTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
deleted file mode 100644
index e664e53b6e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaEnumMapping
- extends AbstractJavaTypeMapping
- implements JaxbEnumMapping {
-
- protected String specifiedXmlEnumValue;
-
- protected final EnumConstantContainer enumConstantContainer;
-
-
- public GenericJavaEnumMapping(JaxbEnum parent) {
- super(parent);
- this.enumConstantContainer = new EnumConstantContainer();
-
- initXmlEnumValue();
- initEnumConstants();
- }
-
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
-
- // ********** sync/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlEnumValue();
- syncEnumConstants();
- }
-
- @Override
- public void update() {
- super.update();
- updateEnumConstants();
- }
-
-
- // ***** XmlEnum.value *****
-
- public String getXmlEnumValue() {
- return (this.specifiedXmlEnumValue != null) ? this.specifiedXmlEnumValue : DEFAULT_XML_ENUM_VALUE;
- }
-
- public String getSpecifiedXmlEnumValue() {
- return this.specifiedXmlEnumValue;
- }
-
- public void setSpecifiedXmlEnumValue(String xmlEnumValue) {
- getXmlEnumAnnotation().setValue(xmlEnumValue);
- setSpecifiedXmlEnumValue_(xmlEnumValue);
- }
-
- protected void setSpecifiedXmlEnumValue_(String xmlEnumValue) {
- String old = this.specifiedXmlEnumValue;
- this.specifiedXmlEnumValue = xmlEnumValue;
- firePropertyChanged(SPECIFIED_XML_ENUM_VALUE_PROPERTY, old, xmlEnumValue);
- }
-
- public String getFullyQualifiedXmlEnumValue() {
- return (this.specifiedXmlEnumValue != null) ?
- getXmlEnumAnnotation().getFullyQualifiedValueClassName()
- : DEFAULT_XML_ENUM_VALUE;
- }
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ENUM);
- }
-
- protected String getResourceXmlEnumValue() {
- return getXmlEnumAnnotation().getValue();
- }
-
- protected void initXmlEnumValue() {
- this.specifiedXmlEnumValue = getResourceXmlEnumValue();
- }
-
- protected void syncXmlEnumValue() {
- setSpecifiedXmlEnumValue_(getResourceXmlEnumValue());
- }
-
-
- // ***** enum constants *****
-
- public Iterable<JaxbEnumConstant> getEnumConstants() {
- return this.enumConstantContainer.getContextElements();
- }
-
- public int getEnumConstantsSize() {
- return this.enumConstantContainer.getContextElementsSize();
- }
-
- protected void initEnumConstants() {
- this.enumConstantContainer.initialize();
- }
-
- protected void syncEnumConstants() {
- this.enumConstantContainer.synchronizeWithResourceModel();
- }
-
- protected void updateEnumConstants() {
- this.enumConstantContainer.update();
- }
-
- protected Iterable<JavaResourceEnumConstant> getResourceEnumConstants() {
- return getJavaResourceType().getEnumConstants();
- }
-
- private JaxbEnumConstant buildEnumConstant(JavaResourceEnumConstant resourceEnumConstant) {
- return getFactory().buildJavaEnumConstant(this, resourceEnumConstant);
- }
-
-
- // ***** misc *****
-
- @Override
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- if (this.specifiedXmlEnumValue != null) {
- return new CompositeIterable<String>(
- super.getNonTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getFullyQualifiedXmlEnumValue()));
- }
- return super.getNonTransientReferencedXmlTypeNames();
- }
-
- public XsdSimpleTypeDefinition getValueXsdTypeDefinition() {
- XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
- if (xsdType == null || xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- return null;
- }
- return (XsdSimpleTypeDefinition) xsdType;
- }
-
- protected XsdTypeDefinition getValueXsdTypeDefinition_() {
- String fqXmlEnumValue = getFullyQualifiedXmlEnumValue();
-
- JaxbType jaxbType = getContextRoot().getType(fqXmlEnumValue);
- if (jaxbType != null) {
- JaxbTypeMapping typeMapping = jaxbType.getMapping();
- if (typeMapping != null) {
- return typeMapping.getXsdTypeDefinition();
- }
- }
- else {
- String typeMapping = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(fqXmlEnumValue);
- if (typeMapping != null) {
- XsdSchema xsdSchema = XsdUtil.getSchemaForSchema();
- return xsdSchema.getTypeDefinition(typeMapping);
- }
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (JaxbEnumConstant constant : getEnumConstants()) {
- result = constant.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateXmlType(messages, reporter, astRoot);
- validateXmlEnum(messages, reporter, astRoot);
-
- for (JaxbEnumConstant constant : getEnumConstants()) {
- constant.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XmlTypeAnnotation annotation = getXmlTypeAnnotation();
-
- if (annotation.getFactoryClass() != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM,
- this,
- annotation.getFactoryClassTextRange(astRoot)));
- }
-
- if (annotation.getFactoryMethod() != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM,
- this,
- annotation.getFactoryMethodTextRange(astRoot)));
- }
-
- if (! CollectionTools.isEmpty(annotation.getPropOrder())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM,
- this,
- annotation.getPropOrderTextRange(astRoot)));
- }
- }
-
- protected void validateXmlEnum(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
- XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
-
- if ((xsdSchema != null && xsdType == null)
- || (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ENUM__NON_SIMPLE_SCHEMA_TYPE,
- new String[] { getFullyQualifiedXmlEnumValue() },
- this,
- getXmlEnumValueTextRange(astRoot)));
- }
- }
-
- protected TextRange getXmlEnumValueTextRange(CompilationUnit astRoot) {
- return getXmlEnumAnnotation().getValueTextRange(astRoot);
- }
-
-
- /**
- * enum constant container adapter
- */
- protected class EnumConstantContainer
- extends ContextCollectionContainer<JaxbEnumConstant, JavaResourceEnumConstant> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return ENUM_CONSTANTS_COLLECTION;
- }
-
- @Override
- protected JaxbEnumConstant buildContextElement(JavaResourceEnumConstant resourceElement) {
- return GenericJavaEnumMapping.this.buildEnumConstant(resourceElement);
- }
-
- @Override
- protected Iterable<JavaResourceEnumConstant> getResourceElements() {
- return GenericJavaEnumMapping.this.getResourceEnumConstants();
- }
-
- @Override
- protected JavaResourceEnumConstant getResourceElement(JaxbEnumConstant contextElement) {
- return contextElement.getResourceEnumConstant();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java
deleted file mode 100644
index 05a0a9d496..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaJaxbClass
- extends AbstractJavaType
- implements JaxbClass {
-
- protected XmlRegistry xmlRegistry;
-
-
- public GenericJavaJaxbClass(JaxbContextNode parent, JavaResourceType resourceType) {
- super(parent, resourceType);
- initXmlRegistry();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- public Kind getKind() {
- return JaxbType.Kind.CLASS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlRegistry();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlRegistry();
- }
-
-
- // ***** mapping *****
-
- @Override
- public JaxbClassMapping getMapping() {
- return (JaxbClassMapping) super.getMapping();
- }
-
- @Override
- protected JaxbClassMapping buildMapping() {
- return getFactory().buildJaxbClassMapping(this);
- }
-
- @Override
- protected boolean isSpecifiedMapped() {
- return getXmlTypeAnnotation() != null
- || getXmlRootElementAnnotation() != null
- || getXmlTransientAnnotation() != null;
- }
-
-
- // ***** XmlRegistry *****
-
- public XmlRegistry getXmlRegistry() {
- return this.xmlRegistry;
- }
-
- protected void setXmlRegistry_(XmlRegistry xmlRegistry) {
- XmlRegistry old = this.xmlRegistry;
- this.xmlRegistry = xmlRegistry;
- firePropertyChanged(XML_REGISTRY_PROPERTY, old, xmlRegistry);
- }
-
- protected XmlRegistryAnnotation getXmlRegistryAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_REGISTRY);
- }
-
- protected XmlRegistry buildXmlRegistry() {
- return getFactory().buildXmlRegistry(this);
- }
-
- protected void initXmlRegistry() {
- if (getXmlRegistryAnnotation() != null) {
- this.xmlRegistry = buildXmlRegistry();
- }
- }
-
- protected void syncXmlRegistry() {
- XmlRegistryAnnotation annotation = getXmlRegistryAnnotation();
- if (annotation != null) {
- if (this.xmlRegistry != null) {
- this.xmlRegistry.synchronizeWithResourceModel();
- }
- else {
- setXmlRegistry_(buildXmlRegistry());
- }
- }
- else if (this.xmlRegistry != null) {
- setXmlRegistry_(null);
- }
- }
-
- protected void updateXmlRegistry() {
- if (this.xmlRegistry != null) {
- this.xmlRegistry.update();
- }
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlRegistry != null) {
- this.xmlRegistry.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java
deleted file mode 100644
index 3cf53874dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-
-public class GenericJavaJaxbEnum
- extends AbstractJavaType
- implements JaxbEnum {
-
- public GenericJavaJaxbEnum(JaxbContextNode parent, JavaResourceEnum resourceType) {
- super(parent, resourceType);
- }
-
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
- public Kind getKind() {
- return JaxbType.Kind.ENUM;
- }
-
-
- // ***** mapping *****
-
- @Override
- public JaxbEnumMapping getMapping() {
- return (JaxbEnumMapping) super.getMapping();
- }
-
- @Override
- protected JaxbEnumMapping buildMapping() {
- return getFactory().buildJaxbEnumMapping(this);
- }
-
- @Override
- protected boolean isSpecifiedMapped() {
- return super.isSpecifiedMapped()
- || getXmlEnumAnnotation() != null;
- }
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ENUM);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
deleted file mode 100644
index 3d278192ee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-public class GenericJavaNullAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation> {
-
- public GenericJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public Annotation getAnnotation() {
- return null;
- }
-
- @Override
- public String getAnnotationName() {
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
deleted file mode 100644
index df21aa2d69..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageInfo
- extends AbstractJavaContextNode
- implements JaxbPackageInfo {
-
- protected final JavaResourcePackage resourcePackage;
-
- protected final XmlSchema xmlSchema;
-
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected final ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation> xmlSchemaTypeContainer;
-
- protected final ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapterContainer;
-
- public GenericJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage) {
- super(parent);
- this.resourcePackage = resourcePackage;
- this.xmlSchema = getFactory().buildJavaXmlSchema(this);
- this.specifiedAccessType = getResourceAccessType();
- this.specifiedAccessOrder = getResourceAccessOrder();
- this.xmlSchemaTypeContainer = this.buildXmlSchemaTypeContainer();
- this.xmlJavaTypeAdapterContainer = this.buildXmlJavaTypeAdapterContainer();
- }
-
-
- public JaxbPackage getJaxbPackage() {
- return (JaxbPackage) getParent();
- }
-
-
- // **************** AbstractJaxbNode impl *********************************
-
- @Override
- public IResource getResource() {
- return this.resourcePackage.getFile();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlSchema.synchronizeWithResourceModel();
- this.setSpecifiedAccessType_(this.getResourceAccessType());
- this.setSpecifiedAccessOrder_(this.getResourceAccessOrder());
- this.syncXmlSchemaTypes();
- this.syncXmlJavaTypeAdapters();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlSchema.update();
- this.updateXmlSchemaTypes();
- this.updateXmlJavaTypeAdapters();
- }
-
-
- // ********** JaxbPackageInfo implementation **********
-
- public JavaResourcePackage getResourcePackage() {
- return this.resourcePackage;
- }
-
- // ********** xml schema **********
-
- public XmlSchema getXmlSchema() {
- return this.xmlSchema;
- }
-
- // ********** access type **********
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.getDefaultAccessType();
- }
-
- public XmlAccessType getSpecifiedAccessType() {
- return this.specifiedAccessType;
- }
-
- public void setSpecifiedAccessType(XmlAccessType access) {
- this.getAccessorTypeAnnotation().setValue(XmlAccessType.toJavaResourceModel(access));
- this.setSpecifiedAccessType_(access);
- }
-
- protected void setSpecifiedAccessType_(XmlAccessType access) {
- XmlAccessType old = this.specifiedAccessType;
- this.specifiedAccessType = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- public XmlAccessType getDefaultAccessType() {
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(this.getAccessorTypeAnnotation().getValue());
- }
-
- protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) this.resourcePackage.getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE);
- }
-
-
- // ********** access order **********
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.getDefaultAccessOrder();
- }
-
- public XmlAccessOrder getSpecifiedAccessOrder() {
- return this.specifiedAccessOrder;
- }
-
- public void setSpecifiedAccessOrder(XmlAccessOrder accessOrder) {
- this.getAccessorOrderAnnotation().setValue(XmlAccessOrder.toJavaResourceModel(accessOrder));
- this.setSpecifiedAccessOrder_(accessOrder);
- }
-
- protected void setSpecifiedAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.specifiedAccessOrder;
- this.specifiedAccessOrder = accessOrder;
- this.firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- public XmlAccessOrder getDefaultAccessOrder() {
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(this.getAccessorOrderAnnotation().getValue());
- }
-
- protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) this.resourcePackage.getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER);
- }
-
-
- // ********** xml schema types **********
-
- public ListIterable<XmlSchemaType> getXmlSchemaTypes() {
- return this.xmlSchemaTypeContainer.getContextElements();
- }
-
- public int getXmlSchemaTypesSize() {
- return this.xmlSchemaTypeContainer.getContextElementsSize();
- }
-
- public XmlSchemaType addXmlSchemaType(int index) {
- XmlSchemaTypeAnnotation annotation = (XmlSchemaTypeAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_SCHEMA_TYPE);
- return this.xmlSchemaTypeContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlSchemaType(XmlSchemaType xmlSchemaType) {
- this.removeXmlSchemaType(this.xmlSchemaTypeContainer.indexOfContextElement(xmlSchemaType));
- }
-
- public void removeXmlSchemaType(int index) {
- this.resourcePackage.removeAnnotation(index, JAXB.XML_SCHEMA_TYPE);
- this.xmlSchemaTypeContainer.removeContextElement(index);
- }
-
- public void moveXmlSchemaType(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_SCHEMA_TYPE);
- this.xmlSchemaTypeContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- return new GenericJavaPackageXmlSchemaType(this, xmlSchemaTypeAnnotation);
- }
-
- protected void syncXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.synchronizeWithResourceModel();
- }
-
- protected void updateXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.update();
- }
-
- protected ListIterable<XmlSchemaTypeAnnotation> getXmlSchemaTypeAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlSchemaTypeAnnotation>(
- this.resourcePackage.getAnnotations(JAXB.XML_SCHEMA_TYPE));
- }
-
- protected ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation> buildXmlSchemaTypeContainer() {
- XmlSchemaTypeContainer container = new XmlSchemaTypeContainer();
- container.initialize();
- return container;
- }
-
-
- // ********** xml java type adapters **********
-
- public ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters() {
- return this.xmlJavaTypeAdapterContainer.getContextElements();
- }
-
- public int getXmlJavaTypeAdaptersSize() {
- return this.xmlJavaTypeAdapterContainer.getContextElementsSize();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index) {
- XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER);
- return this.xmlJavaTypeAdapterContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlSchemaType) {
- this.removeXmlJavaTypeAdapter(this.xmlJavaTypeAdapterContainer.indexOfContextElement(xmlSchemaType));
- }
-
- public void removeXmlJavaTypeAdapter(int index) {
- this.resourcePackage.removeAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.xmlJavaTypeAdapterContainer.removeContextElement(index);
- }
-
- public void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.xmlJavaTypeAdapterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaPackageXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void updateXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.update();
- }
-
- protected void syncXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getXmlJavaTypeAdapterAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlJavaTypeAdapterAnnotation>(
- this.resourcePackage.getAnnotations(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- protected ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> buildXmlJavaTypeAdapterContainer() {
- XmlJavaTypeAdapterContainer container = new XmlJavaTypeAdapterContainer();
- container.initialize();
- return container;
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter(String boundTypeName) {
- for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) {
- if (boundTypeName.equals(adapter.getFullyQualifiedType())) {
- return adapter;
- }
- }
- return null;
- }
-
-
- // ***** misc *****
-
- protected CompilationUnit buildASTRoot() {
- return this.resourcePackage.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- public String getNamespaceForPrefix(String prefix) {
- if (this.xmlSchema != null) {
- for (XmlNs xmlns : this.xmlSchema.getXmlNsPrefixes()) {
- if (StringTools.stringsAreEqual(xmlns.getPrefix(), prefix)) {
- return xmlns.getNamespaceURI();
- }
- }
- }
- return null;
- }
-
- public String getPrefixForNamespace(String namespace) {
- if (this.xmlSchema != null) {
- for (XmlNs xmlns : this.xmlSchema.getXmlNsPrefixes()) {
- if (StringTools.stringsAreEqual(xmlns.getNamespaceURI(), namespace)) {
- return xmlns.getPrefix();
- }
- }
- }
- return null;
- }
-
-
- // ***** content assist ******
-
- //This doesn't actually work yet because of JDT bug (bugs.eclipse.org/326610)
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- getJaxbProject().getSchemaLibrary().refreshSchema(getJaxbPackage().getNamespace());
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlSchema.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- for (XmlSchemaType xmlSchemaType : this.getXmlSchemaTypes()) {
- result = xmlSchemaType.getJavaCompletionProposals(pos, filter, astRoot);
- if (!CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourcePackage.getNameTextRange(astRoot);
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- IFile file = this.resourcePackage.getFile();
- // 'file' will be null if the type is "external" and binary;
- // the file will be in a different project if the type is "external" and source;
- // the type will be binary if it is in a JAR in the current project
- if ((file != null)
- && file.getProject().equals(getJaxbProject().getProject())
- && (this.resourcePackage instanceof SourceNode)) {
- // build the AST root here to pass down
- this.validate(messages, reporter, this.buildASTRoot());
- }
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlSchema.validate(messages, reporter, astRoot);
-
- for (XmlSchemaType schemaType : getXmlSchemaTypes()) {
- schemaType.validate(messages, reporter, astRoot);
- }
-
- for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) {
- adapter.validate(messages, reporter, astRoot);
- }
- }
-
-
- /**
- * xml schema type container
- */
- protected class XmlSchemaTypeContainer
- extends ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return XML_SCHEMA_TYPES_LIST;
- }
- @Override
- protected XmlSchemaType buildContextElement(XmlSchemaTypeAnnotation resourceElement) {
- return GenericJavaPackageInfo.this.buildXmlSchemaType(resourceElement);
- }
- @Override
- protected ListIterable<XmlSchemaTypeAnnotation> getResourceElements() {
- return GenericJavaPackageInfo.this.getXmlSchemaTypeAnnotations();
- }
- @Override
- protected XmlSchemaTypeAnnotation getResourceElement(XmlSchemaType contextElement) {
- return contextElement.getXmlSchemaTypeAnnotation();
- }
- }
-
- /**
- * xml java type adapter container
- */
- protected class XmlJavaTypeAdapterContainer
- extends ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XML_JAVA_TYPE_ADAPTERS_LIST;
- }
-
- @Override
- protected XmlJavaTypeAdapter buildContextElement(XmlJavaTypeAdapterAnnotation resourceElement) {
- return GenericJavaPackageInfo.this.buildXmlJavaTypeAdapter(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getResourceElements() {
- return GenericJavaPackageInfo.this.getXmlJavaTypeAdapterAnnotations();
- }
-
- @Override
- protected XmlJavaTypeAdapterAnnotation getResourceElement(XmlJavaTypeAdapter contextElement) {
- return contextElement.getAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
deleted file mode 100644
index 00f539662f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaPackageXmlJavaTypeAdapter(JaxbPackageInfo parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- protected String buildDefaultType() {
- //there is no default type on a package level XmlJavaTypeAdapter, it must be specified
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getSpecifiedType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED,
- this,
- getAnnotation().getTypeTextRange(astRoot)));
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java
deleted file mode 100644
index 04480116be..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageXmlSchemaType
- extends GenericJavaXmlSchemaType
-{
-
- public GenericJavaPackageXmlSchemaType(JaxbPackageInfo parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- protected JaxbPackageInfo getJaxbPackageInfo() {
- return getParent();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return getJaxbPackageInfo().getJaxbPackage();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String fqType = getFullyQualifiedType();
- if (fqType == null || XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
deleted file mode 100644
index 01edcb52ef..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPersistentAttribute
- extends AbstractJavaContextNode
- implements JaxbPersistentAttribute {
-
- protected final Accessor accessor;
-
- protected JaxbAttributeMapping mapping; // never null
-
- protected String defaultMappingKey;
-
-
-
- public static JaxbPersistentAttribute buildPersistentProperty(
- JaxbClassMapping parent,
- JavaResourceMethod resourceGetter,
- JavaResourceMethod resourceSetter) {
- return new GenericJavaPersistentAttribute(
- parent, new PropertyAccessor(parent, resourceGetter, resourceSetter));
- }
-
- public static JaxbPersistentAttribute buildPersistentField(
- JaxbClassMapping parent,
- JavaResourceField resourceField) {
- return new GenericJavaPersistentAttribute(
- parent, new FieldAccessor(parent, resourceField));
- }
-
-
- public GenericJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor) {
- super(parent);
- this.accessor = accessor;
- // keep non-null at all times
- this.mapping = this.buildMapping();
- }
-
- public JaxbClassMapping getClassMapping() {
- return (JaxbClassMapping) super.getParent();
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncMapping();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateMapping();
- }
-
-
- // ***** declaring class/ inheritance *****
-
- public JavaResourceType getDeclaringJavaResourceType() {
- return this.accessor.getJavaResourceAttribute().getResourceType();
- }
-
- public boolean isInherited() {
- return getDeclaringJavaResourceType() != getClassMapping().getJaxbType().getJavaResourceType();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.getJavaResourceAttribute().getName();
- }
-
-
- // ***** accessor *****
-
- public boolean isFor(JavaResourceField resourceField) {
- return this.accessor.isFor(resourceField);
- }
-
- public boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return this.accessor.isFor(resourceGetter, resourceSetter);
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.accessor.getJavaResourceAttribute();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- return this.accessor.getJavaResourceAttributeBaseTypeName();
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- return this.accessor.isJavaResourceAttributeCollectionType();
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return this.accessor.isJavaResourceAttributeTypeSubTypeOf(typeName);
- }
-
- // ********** mapping **********
-
- public JaxbAttributeMapping getMapping() {
- return this.mapping;
- }
-
- /**
- * Clients do not set the mapping directly.
- * @see #setMappingKey(String)
- */
- protected void setMapping(JaxbAttributeMapping mapping) {
- JaxbAttributeMapping old = this.mapping;
- this.mapping = mapping;
- this.firePropertyChanged(MAPPING_PROPERTY, old, mapping);
- }
-
- public String getMappingKey() {
- return this.mapping.getKey();
- }
-
- /**
- * Possible transitions:
- * <table border>
- * <th>
- * <th>null mapping/default<br>
- * <code>key = null</code>
- * <th>specified mapping A<br>
- * <code>key = "A"</code>
- * <th>specified mapping B<br>
- * <code>key = "B"</code>
- * <tr>
- * <th>[default] null mapping
- * <td>do nothing
- * <td>add annotation A<br>
- * set new mapping A
- * <td>add annotation B<br>
- * set new mapping B
- * <tr>
- * <th>default mapping A
- * <td>do nothing
- * <td>add annotation A<br>
- * <em>re-use</em> default mapping A
- * <td>add annotation B<br>
- * set new mapping B
- * <tr>
- * <th>specified mapping A
- * <td>remove annotation A<br>
- * set new default or null mapping
- * <td>do nothing
- * <td>remove annotation A<br>
- * add annotation B<br>
- * set new mapping B
- * </table>
- * The "do nothing" transitions are handled in this method.
- */
- public JaxbAttributeMapping setMappingKey(String key) {
- if (this.mapping.isDefault()) {
- if (key == null) {
- // leave the default mapping unchanged
- } else {
- this.setMappingKey_(key); // replace the default mapping
- }
- } else {
- if (this.valuesAreEqual(key, this.mapping.getKey())) {
- // leave the specified mapping unchanged
- } else {
- this.setMappingKey_(key); // replace the specified mapping
- }
- }
- return this.mapping;
- }
-
- /**
- * We have either:<ul>
- * <li>a <em>default</em> mapping and a non-<code>null</code> key
- * </ul>or<ul>
- * <li>a <em>specified</em> mapping and a different (possibly
- * <code>null</code>) key
- * </ul>
- */
- protected void setMappingKey_(String key) {
- JavaAttributeMappingDefinition definition = this.getSpecifiedMappingDefinition(key);
- if (definition == null) {
- // our mapping is "specified" and the key is null;
- // check for a default definition
- definition = this.getDefaultMappingDefinition();
- Iterable<String> supportingAnnotationNames = (definition != null) ? definition.getSupportingAnnotationNames() : EmptyIterable.<String>instance();
- // clear any mapping annotation(s);
- // leave the "default" mapping's supporting annotations;
- // if there is no "default" mapping, clear all supporting annotations too(?)
- this.setMappingAnnotation(null, supportingAnnotationNames);
- } else {
- this.setMappingAnnotation(definition);
- }
- // note: 'definition' can still be null (if the key is null and there is no "default" mapping)
- this.setMapping(this.buildMapping(definition));
- }
-
- /**
- * pre-condition: definition is not <code>null</code>
- */
- protected void setMappingAnnotation(JavaAttributeMappingDefinition definition) {
- this.setMappingAnnotation(definition.getAnnotationName(), definition.getSupportingAnnotationNames());
- }
-
- protected void setMappingAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- this.getJavaResourceAttribute().setPrimaryAnnotation(primaryAnnotationName, supportingAnnotationNames);
- }
-
- protected JaxbAttributeMapping buildMapping(JavaAttributeMappingDefinition definition) {
- return (definition == null) ? this.buildNullMapping() : this.buildMapping_(definition);
- }
-
- protected JaxbAttributeMapping buildNullMapping() {
- return this.getFactory().buildJavaNullAttributeMapping(this);
- }
-
- /**
- * pre-condition: definition is not null
- * <p>
- * If we are converting a <em>default</em> mapping to its <em>specified</em>
- * manifestation, we just keep the same mapping and create its annotation.
- * We do <em>not</em> do the same thing when converting a <em>specified</em>
- * mapping to its <em>default</em> manifestation. We rebuild the
- * entire mapping, simplifying the clearing of all its state. We do this
- * because we allow clients to modify a <em>default</em> mapping (or any of
- * its components) directly,
- * modifying its state and triggering a conversion to a <em>specified</em>
- * mapping. The only way to convert a <em>specified</em> mapping to a
- * <em>default</em> mapping is by {@link #setMappingKey(String) setting the
- * mapping key} to <code>null</code>.
- */
- protected JaxbAttributeMapping buildMapping_(JavaAttributeMappingDefinition definition) {
- // 'mapping' is null during construction
- if ((this.mapping != null) && this.mapping.isDefault() && Tools.valuesAreEqual(this.mapping.getKey(), definition.getKey())) {
- this.mapping.synchronizeWithResourceModel(); // the mapping instance hasn't changed, but some resource differences may have resulted
- return this.mapping;
- }
- return definition.buildMapping(this, this.getFactory());
- }
-
- /**
- * We only look for a <em>specified</em> mapping here.
- * We look for a default mapping during <em>update</em>.
- */
- protected JaxbAttributeMapping buildMapping() {
- return this.buildMapping(this.getSpecifiedMappingDefinition());
- }
-
- /**
- * Look for a <em>specified</em> mapping and sync our mapping.
- */
- protected void syncMapping() {
- JavaAttributeMappingDefinition definition = this.getSpecifiedMappingDefinition();
- if (definition == null) {
- if (this.mapping.isDefault()) {
- // null/default => null/default
- this.mapping.synchronizeWithResourceModel();
- } else {
- // specified => null/default
- definition = this.getDefaultMappingDefinition();
- this.setMapping(this.buildMapping(definition));
- }
- } else {
- if (this.mapping.isDefault()) {
- // null/default => specified
- // (will not change mapping instance if keys are the same, but will sync the mapping)
- this.setMapping(this.buildMapping(definition));
- } else {
- // specified => specified
- if (this.valuesAreEqual(definition.getKey(), this.mapping.getKey())) {
- this.mapping.synchronizeWithResourceModel();
- } else {
- this.setMapping(this.buildMapping(definition));
- }
- }
- }
- }
-
- /**
- * Return the "specified" mapping definition for the specified key.
- */
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition(String key) {
- if (key == null) {
- return null;
- }
- for (JavaAttributeMappingDefinition definition : this.getSpecifiedMappingDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), key)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("invalid mapping key: " + key); //$NON-NLS-1$
- }
-
- /**
- * Return the mapping definition for the mapping currently specified in the
- * source code.
- */
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition() {
- for (JavaAttributeMappingDefinition definition : this.getSpecifiedMappingDefinitions()) {
- if (definition.isSpecified(this)) {
- return definition;
- }
- }
- return null;
- }
-
- protected Iterable<JavaAttributeMappingDefinition> getSpecifiedMappingDefinitions() {
- return this.getPlatform().getSpecifiedJavaAttributeMappingDefinitions();
- }
-
-
- // ********** default mapping **********
-
- public String getDefaultMappingKey() {
- return this.defaultMappingKey;
- }
-
- protected void setDefaultMappingKey(String mappingKey) {
- String old = this.defaultMappingKey;
- this.defaultMappingKey = mappingKey;
- this.firePropertyChanged(DEFAULT_MAPPING_KEY_PROPERTY, old, mappingKey);
- }
-
- /**
- * If a mapping annotation is specified, we would have already set a
- * <em>specified</em> mapping in {@link #syncMapping()}. We need only check
- * for changes to the <em>default</em> mapping.
- */
- protected void updateMapping() {
- JavaAttributeMappingDefinition definition = this.getDefaultMappingDefinition();
- String newDefaultKey = (definition == null) ? null : definition.getKey();
- if (this.mapping.isDefault() && Tools.valuesAreDifferent(this.mapping.getKey(), newDefaultKey)) {
- this.setMapping(this.buildMapping(definition)); // the default mapping has changed
- } else {
- this.mapping.update();
- }
- this.setDefaultMappingKey(newDefaultKey);
- }
-
- protected JavaAttributeMappingDefinition getDefaultMappingDefinition() {
- for (DefaultJavaAttributeMappingDefinition definition : this.getDefaultMappingDefinitions()) {
- if (definition.isDefault(this)) {
- return definition;
- }
- }
- return null;
- }
-
- protected Iterable<DefaultJavaAttributeMappingDefinition> getDefaultMappingDefinitions() {
- return this.getPlatform().getDefaultJavaAttributeMappingDefinitions();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.mapping.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getJavaResourceAttribute().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // validate that unsupported annotations are not present
- JavaAttributeMappingDefinition currentMappingDefinition = getCurrentMappingDefinition();
- Iterable<String> supportingAnnotationNames = currentMappingDefinition.getSupportingAnnotationNames();
-
- for (Annotation annotation : getJavaResourceAttribute().getTopLevelAnnotations()) {
- if (Tools.valuesAreDifferent(currentMappingDefinition.getAnnotationName(), annotation.getAnnotationName())
- && ! CollectionTools.contains(supportingAnnotationNames, annotation.getAnnotationName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION,
- new String[] { annotation.getAnnotationName(), currentMappingDefinition.getAnnotationName() },
- this,
- annotation.getTextRange(astRoot)));
- }
- }
-
- this.getMapping().validate(messages, reporter, astRoot);
- }
-
- protected JavaAttributeMappingDefinition getCurrentMappingDefinition() {
- Iterable<? extends JavaAttributeMappingDefinition> mappingDefinitions =
- (this.mapping.isDefault()) ?
- getDefaultMappingDefinitions()
- : getSpecifiedMappingDefinitions();
-
- for (JavaAttributeMappingDefinition mappingDefinition : mappingDefinitions) {
- if (Tools.valuesAreEqual(mappingDefinition.getKey(), this.mapping.getKey())) {
- return mappingDefinition;
- }
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java
deleted file mode 100644
index 10a874665f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public class GenericJavaTypeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaTypeXmlJavaTypeAdapter(JaxbType parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbType getParent() {
- return (JaxbType) super.getParent();
- }
-
- // ********** type **********
- @Override
- protected String buildDefaultType() {
- return getParent().getJavaResourceType().getQualifiedName();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java
deleted file mode 100644
index b71db30e34..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-public class GenericJavaXmlAdapter
- extends AbstractJavaContextNode
- implements XmlAdapter {
-
- protected final JavaResourceType resourceType;
-
- protected String boundType;
-
- protected String valueType;
-
-
- public GenericJavaXmlAdapter(JavaContextNode parent, JavaResourceType resourceType) {
- super(parent);
- this.resourceType = resourceType;
- initBoundAndValueTypes();
- }
-
-
- public JavaResourceType getJavaResourceType() {
- return this.resourceType;
- }
-
-
- // ***** overrides *****
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // ***** sync/update *****
-
- protected void initBoundAndValueTypes() {
- String[] types = findBoundAndValueTypes(getJavaResourceType());
- this.boundType = types[0];
- this.valueType = types[1];
- }
-
-
- @Override
- public void update() {
- super.update();
- // these are in update, since their values may depend on other classes
- updateBoundAndValueTypes();
- }
-
- protected void updateBoundAndValueTypes() {
- String[] types = findBoundAndValueTypes(getJavaResourceType());
- setBoundType_(types[0]);
- setValueType_(types[1]);
- }
-
- protected String[] findBoundAndValueTypes(JavaResourceType resourceType) {
- for (JavaResourceMethod resourceMethod : resourceType.getMethods()) {
- if (MARSHAL_METHOD_NAME.equals(resourceMethod.getName()) && resourceMethod.getParametersSize() == 1) {
- String valueType = resourceMethod.getTypeName();
- String boundType = resourceMethod.getParameterTypeName(0);
- return new String[] { boundType, valueType };
- }
- }
-
- String superResourceTypeName = resourceType.getSuperclassQualifiedName();
- if (! StringTools.stringIsEmpty(superResourceTypeName)) {
- JavaResourceType superResourceType
- = (JavaResourceType) getJaxbProject().getJavaResourceType(superResourceTypeName, JavaResourceAbstractType.Kind.TYPE);
- if (superResourceType != null) {
- return findBoundAndValueTypes(superResourceType);
- }
- }
-
- String objectTypeName = Object.class.getName();
- return new String[] { objectTypeName, objectTypeName };
- }
-
-
- // ***** bound type *****
-
- public String getBoundType() {
- return this.boundType;
- }
-
- protected void setBoundType_(String newType) {
- String oldType = this.boundType;
- this.boundType = newType;
- firePropertyChanged(BOUND_TYPE_PROPERTY, oldType, newType);
- }
-
-
- // ***** value type *****
-
- public String getValueType() {
- return this.valueType;
- }
-
- protected void setValueType_(String newType) {
- String oldType = this.valueType;
- this.valueType = newType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, oldType, newType);
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJavaResourceType().getNameTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
deleted file mode 100644
index 6b94b4273d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAnyAttributeMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlAnyAttributeAnnotation>
- implements XmlAnyAttributeMapping {
-
- public GenericJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlJavaTypeAdapter();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Map.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__NON_MAP_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
deleted file mode 100644
index a5d9f92acf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAnyElementMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlAnyElementAnnotation>
- implements XmlAnyElementMapping {
-
- protected Boolean specifiedLax;
-
- protected String specifiedValue;
-
- protected final XmlElementRefs xmlElementRefs;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.specifiedLax = buildSpecifiedLax();
- this.specifiedValue = getResourceValueString();
- this.xmlElementRefs = buildXmlElementRefs();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedLax_(buildSpecifiedLax());
- setSpecifiedValue_(getResourceValueString());
- this.xmlElementRefs.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefs.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** lax *****
-
- public boolean isLax() {
- return (getSpecifiedLax() == null) ? isDefaultLax() : getSpecifiedLax().booleanValue();
- }
-
- public Boolean getSpecifiedLax() {
- return this.specifiedLax;
- }
-
- public void setSpecifiedLax(Boolean newSpecifiedLax) {
- getOrCreateAnnotation().setLax(newSpecifiedLax);
- setSpecifiedLax_(newSpecifiedLax);
- }
-
- protected void setSpecifiedLax_(Boolean newSpecifiedLax) {
- Boolean oldLax = this.specifiedLax;
- this.specifiedLax = newSpecifiedLax;
- firePropertyChanged(SPECIFIED_LAX_PROPERTY, oldLax, newSpecifiedLax);
- }
-
- protected Boolean buildSpecifiedLax() {
- return getAnnotation().getLax();
- }
-
- public boolean isDefaultLax() {
- return DEFAULT_LAX;
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return getSpecifiedValue() == null ? getDefaultValue() : getSpecifiedValue();
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String location) {
- getOrCreateAnnotation().setValue(location);
- setSpecifiedValue_(location);
- }
-
- protected void setSpecifiedValue_(String type) {
- String old = this.specifiedValue;
- this.specifiedValue = type;
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, type);
- }
-
- protected String getResourceValueString() {
- return getAnnotation().getValue();
- }
-
- public String getDefaultValue() {
- return DEFAULT_VALUE;
- }
-
-
- // ***** XmlElementRefs *****
-
- public XmlElementRefs getXmlElementRefs() {
- return this.xmlElementRefs;
- }
-
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRefs.getReferencedXmlTypeNames();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRefs.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRefs.validate(messages, reporter, astRoot);
-
- if (getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS) != null) {
- XmlElementRefAnnotation xmlElementRefAnnotation =
- (XmlElementRefAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF);
- if (xmlElementRefAnnotation != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION,
- new String[] { JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS },
- getPersistentAttribute(),
- xmlElementRefAnnotation.getTextRange(astRoot)));
- }
- }
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlMixed != null) {
- this.xmlMixed.validate(messages, reporter, astRoot);
- }
- }
-
- protected class XmlElementRefsContext
- implements GenericJavaXmlElementRefs.Context {
-
- protected XmlElementRefsAnnotation getXmlElementRefsAnnotation() {
- return (XmlElementRefsAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected XmlElementRefsAnnotation addXmlElementRefsAnnotation() {
- return (XmlElementRefsAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected void removeXmlElementRefsAnnotation() {
- GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected XmlElementRefAnnotation getXmlElementRefAnnotation() {
- return (XmlElementRefAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- protected XmlElementRefAnnotation addXmlElementRefAnnotation() {
- return (XmlElementRefAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- protected void removeXmlElementRefAnnotation() {
- GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.getXmlElementRefs();
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- return new SingleElementListIterable(xmlElementRefAnnotation);
- }
-
- return EmptyListIterable.instance();
- }
-
- public XmlElementRefAnnotation addXmlElementRefAnnotation(int index) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.addXmlElementRef(index);
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- if (index > 1) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- xmlElementRefsAnnotation = addXmlElementRefsAnnotation();
- XmlElementRefAnnotation xmlElementRefAnnotationCopy = xmlElementRefsAnnotation.addXmlElementRef(0);
- xmlElementRefAnnotationCopy.setName(xmlElementRefAnnotation.getName());
- xmlElementRefAnnotationCopy.setNamespace(xmlElementRefAnnotation.getNamespace());
- xmlElementRefAnnotationCopy.setRequired(xmlElementRefAnnotation.getRequired());
- xmlElementRefAnnotationCopy.setType(xmlElementRefAnnotation.getType());
-
- removeXmlElementRefAnnotation();
-
- return xmlElementRefsAnnotation.addXmlElementRef(index);
- }
-
- if (index > 0) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- return addXmlElementRefAnnotation();
- }
-
- public void removeXmlElementRefAnnotation(int index) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- xmlElementRefsAnnotation.removeXmlElementRef(index);
- if (xmlElementRefsAnnotation.getXmlElementRefsSize() == 0) {
- removeXmlElementRefsAnnotation();
- }
- else if (xmlElementRefsAnnotation.getXmlElementRefsSize() == 1) {
- XmlElementRefAnnotation xmlElementRefAnnotation = CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0);
- XmlElementRefAnnotation xmlElementRefAnnotationCopy = addXmlElementRefAnnotation();
- xmlElementRefAnnotationCopy.setName(xmlElementRefAnnotation.getName());
- xmlElementRefAnnotationCopy.setNamespace(xmlElementRefAnnotation.getNamespace());
- xmlElementRefAnnotationCopy.setRequired(xmlElementRefAnnotation.getRequired());
- xmlElementRefAnnotationCopy.setType(xmlElementRefAnnotation.getType());
- removeXmlElementRefsAnnotation();
- }
- return;
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- if (index != 0) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- removeXmlElementRefAnnotation();
- return;
- }
-
- throw new IllegalArgumentException(String.valueOf(index));
- }
-
- public void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex) {
- if (targetIndex == sourceIndex) {
- return;
- }
-
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation == null) {
- throw new IllegalArgumentException(String.valueOf(targetIndex) + ", " + String.valueOf(sourceIndex));
- }
- xmlElementRefsAnnotation.moveXmlElementRef(targetIndex, sourceIndex);
- }
-
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.getTextRange(astRoot);
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- return xmlElementRefAnnotation.getTextRange(astRoot);
- }
-
- return GenericJavaXmlAnyElementMapping.this.getValidationTextRange(astRoot);
- }
- }
-
-
- protected class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- protected XmlElementRefAnnotation annotation;
-
- public XmlElementRefContext(XmlElementRefAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlAnyElementMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlAnyElementMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java
deleted file mode 100644
index e7ca2fc909..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttachmentRef;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-public class GenericJavaXmlAttachmentRef
- extends AbstractJavaContextNode
- implements XmlAttachmentRef {
-
- protected final XmlAttachmentRefAnnotation resourceXmlAttachmentRef;
-
-
- public GenericJavaXmlAttachmentRef(JaxbAttributeMapping parent, XmlAttachmentRefAnnotation resource) {
- super(parent);
- this.resourceXmlAttachmentRef = resource;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlAttachmentRef.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
deleted file mode 100644
index 7d9428c5a5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdAttributeUse;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAttributeMapping
- extends AbstractJavaXmlNamedNodeMapping<XmlAttributeAnnotation>
- implements XmlAttributeMapping {
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
-
- public GenericJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlAttributeQName(this);
- }
-
-
- // ***** XmlAttribute.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getOrCreateAnnotation().setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- XmlAttributeAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlList *****
-
- @Override
- protected boolean calculateDefaultXmlList() {
- return getPersistentAttribute().isJavaResourceAttributeCollectionType();
- }
-
-
- // ***** XmlIDREF *****
-
- @Override
- protected GenericJavaXmlIDREF.Context buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- public XsdFeature getXsdFeature() {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type != null) {
- XsdAttributeUse attributeUse = type.getAttribute(this.qName.getNamespace(), this.qName.getName());
- return (attributeUse == null) ? null : attributeUse.getAttributeDeclaration();
- }
- return null;
- }
-
- @Override
- public XsdTypeDefinition getDataTypeXsdTypeDefinition() {
- XsdTypeDefinition xsdType = super.getDataTypeXsdTypeDefinition();
- if (xsdType != null
- && isXmlList()
- && xsdType.getKind() == XsdTypeDefinition.Kind.SIMPLE
- && ((XsdSimpleTypeDefinition) xsdType).getItemType() != null) {
- xsdType = ((XsdSimpleTypeDefinition) xsdType).getItemType();
- }
- return xsdType;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateQName(messages, reporter, astRoot);
- validateSchemaType(messages, reporter, astRoot);
- }
-
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.qName.validate(messages, reporter, astRoot);
- }
-
- protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdFeature xsdFeature = getXsdFeature();
- if (xsdFeature == null) {
- return;
- }
-
- XsdTypeDefinition expectedSchemaType = null;
- if (this.xmlID != null) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID");
- }
- else if (this.xmlIDREF != null) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF");
- }
- else {
- expectedSchemaType = getDataTypeXsdTypeDefinition();
- }
-
- if (expectedSchemaType == null) {
- return;
- }
-
- boolean isItemType = isXmlList() && this.xmlSchemaType == null;
- if (! xsdFeature.typeIsValid(expectedSchemaType, isItemType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ATTRIBUTE__INVALID_SCHEMA_TYPE,
- new String[] { getValueTypeName(), xsdFeature.getName() },
- this,
- this.qName.getNameTextRange(astRoot)));
- }
- }
-
-
- protected class XmlAttributeQName
- extends AbstractJavaQName {
-
- protected XmlAttributeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlAttributeMapping.this.getJaxbPackage();
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ATTRIBUTE_DESC;
- }
-
- @Override
- public String getDefaultName() {
- return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttribute().getName();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = GenericJavaXmlAttributeMapping.this.getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? EmptyIterable.instance() : xsdType.getAttributeNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage != null && jaxbPackage.getAttributeFormDefault() == XmlNsForm.QUALIFIED) ?
- GenericJavaXmlAttributeMapping.this.getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type != null) {
- if (type.getAttribute(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- if (createIfNull) {
- return GenericJavaXmlAttributeMapping.this.getOrCreateAnnotation();
- }
- else {
- return GenericJavaXmlAttributeMapping.this.getAnnotation();
- }
- }
- }
-
-
- protected class XmlIDREFContext
- extends AbstractJavaXmlNamedNodeMapping.XmlIDREFContext {
-
- public Iterable<ValidatableReference> getReferences() {
-
- return new SingleElementIterable<ValidatableReference>(
-
- new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- // 1) if we're getting here, XmlIDREF will not be null
- // 2) use the @XmlIDREF text range, since there is no specific place where the type is specified
- return GenericJavaXmlAttributeMapping.this.getXmlIDREF().getValidationTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return GenericJavaXmlAttributeMapping.this.getXsdFeature();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return GenericJavaXmlAttributeMapping.this.getQName().getNameTextRange(astRoot);
- }
- });
- }
-
- @Override
- public boolean isList() {
- return super.isList()
- || GenericJavaXmlAttributeMapping.this.getPersistentAttribute().isJavaResourceAttributeCollectionType();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
deleted file mode 100644
index e207b7f13e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElement
- extends AbstractJavaContextNode
- implements XmlElement {
-
- protected final Context context;
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedNillable;
-
- protected boolean defaultNillable;
-
- protected Boolean specifiedRequired;
-
- protected String defaultValue;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- public GenericJavaXmlElement(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedNillable = buildSpecifiedNillable();
- this.defaultNillable = buildDefaultNillable();
- this.specifiedRequired = buildSpecifiedRequired();
- this.defaultValue = buildDefaultValue();
- this.specifiedType = buildSpecifiedType();
- this.defaultType = buildDefaultType();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedNillable_(buildSpecifiedNillable());
- setDefaultNillable_(buildDefaultNillable());
- setSpecifiedRequired_(buildSpecifiedRequired());
- setDefaultValue_(buildDefaultValue());
- setSpecifiedType_(buildSpecifiedType());
- setDefaultType_(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- protected Context getContext() {
- return this.context;
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getContext().getAttributeMapping();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getContext().getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- return this.context.getAnnotation(createIfNull);
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlElementQName(this);
- }
-
-
- // ***** XmlElement.nillable *****
-
- public boolean isNillable() {
- return (this.specifiedNillable == null) ? isDefaultNillable() : getSpecifiedNillable().booleanValue();
- }
-
- public Boolean getSpecifiedNillable() {
- return this.specifiedNillable;
- }
-
- public void setSpecifiedNillable(Boolean newSpecifiedNillable) {
- getAnnotation(true).setNillable(newSpecifiedNillable);
- setSpecifiedNillable_(newSpecifiedNillable);
- }
-
- protected void setSpecifiedNillable_(Boolean newSpecifiedNillable) {
- Boolean oldNillable = this.specifiedNillable;
- this.specifiedNillable = newSpecifiedNillable;
- firePropertyChanged(SPECIFIED_NILLABLE_PROPERTY, oldNillable, newSpecifiedNillable);
- }
-
- protected Boolean buildSpecifiedNillable() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNillable();
- }
-
- public boolean isDefaultNillable() {
- return this.defaultNillable;
- }
-
- protected void setDefaultNillable_(boolean newNillable) {
- boolean oldNillable = this.defaultNillable;
- this.defaultNillable = newNillable;
- firePropertyChanged(DEFAULT_NILLABLE_PROPERTY, oldNillable, newNillable);
- }
-
- protected boolean buildDefaultNillable() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getPersistentAttribute().isJavaResourceAttributeCollectionType() : false;
- }
-
-
- // ***** XmlElement.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation(true).setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlElement.defaultValue *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- getAnnotation(true).setDefaultValue(defaultValue);
- setDefaultValue_(defaultValue);
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String oldDefaultValue = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, oldDefaultValue, defaultValue);
- }
-
- protected String buildDefaultValue() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getDefaultValue();
- }
-
-
- // ***** XmlElement.type *****
-
- public String getType() {
- return (this.specifiedType == null) ? getDefaultType() : this.specifiedType;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- getAnnotation(true).setType(newSpecifiedType);
- setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getType();
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(String newType) {
- String oldType = this.defaultType;
- this.defaultType = newType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldType, newType);
- }
-
- protected String buildDefaultType() {
- return this.context.getDefaultType();
- }
-
- public String getFullyQualifiedType() {
- return (this.specifiedType == null) ? getDefaultType() : getAnnotation(false).getFullyQualifiedTypeName();
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- // only return the specified type - the default type should already be included
- return (this.specifiedType == null) ?
- EmptyIterable.<String>instance()
- : new SingleElementIterable(getFullyQualifiedType());
- }
-
- public XsdElementDeclaration getXsdElement() {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName());
- }
-
- /**
- * Return the expected schema type associated with the data type
- */
- public XsdTypeDefinition getTypeXsdTypeDefinition() {
- String type = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(type) || XmlElement.DEFAULT_TYPE_PROPERTY.equals(type)) {
- return null;
- }
-
- JaxbPackage pkg = getJaxbPackage();
- JaxbPackageInfo pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- for (XmlSchemaType schemaType : pkgInfo.getXmlSchemaTypes()) {
- if (type.equals(schemaType.getFullyQualifiedType())) {
- return schemaType.getXsdTypeDefinition();
- }
- }
- }
-
- JaxbTypeMapping jaxbTypeMapping = getContextRoot().getTypeMapping(type);
- if (jaxbTypeMapping != null) {
- return jaxbTypeMapping.getXsdTypeDefinition();
- }
-
- String builtInType = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(type);
- if (builtInType != null) {
- return XsdUtil.getSchemaForSchema().getTypeDefinition(builtInType);
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTextRange(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTypeTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validateQName(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
- validateSchemaType(messages, reporter, astRoot);
- }
-
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.qName.validate(messages, reporter, astRoot);
- }
-
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String fqType = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__UNSPECIFIED_TYPE,
- this,
- getTypeTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(this.specifiedType)
- // verify that type actually exists before validating
- && JDTTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
- String attributeBaseType = getAttributeMapping().getValueTypeName();
- if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeBaseType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__ILLEGAL_TYPE,
- new String[] { attributeBaseType },
- this,
- getTypeTextRange(astRoot)));
-
- }
- }
- }
-
- protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdElementDeclaration xsdElement = getXsdElement();
- if (xsdElement == null) {
- return;
- }
-
- XsdTypeDefinition expectedSchemaType = null;
- String typeName = this.context.getAttributeMapping().getDataTypeName();
- if (! XmlElement.DEFAULT_TYPE_PROPERTY.equals(getFullyQualifiedType())) {
- typeName = getFullyQualifiedType();
- }
-
- if (this.context.hasXmlID()) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID");
- }
- else if (this.context.hasXmlIDREF()) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF");
- }
- else if (this.context.hasXmlSchemaType()) {
- expectedSchemaType = this.context.getXmlSchemaType().getXsdTypeDefinition();
- }
- else if (! XmlElement.DEFAULT_TYPE_PROPERTY.equals(getFullyQualifiedType())) {
- expectedSchemaType = getTypeXsdTypeDefinition();
- }
- else {
- expectedSchemaType = this.context.getAttributeMapping().getDataTypeXsdTypeDefinition();
- }
-
- if (expectedSchemaType == null) {
- return;
- }
-
- if (! xsdElement.typeIsValid(expectedSchemaType, this.context.hasXmlList())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__INVALID_SCHEMA_TYPE,
- new String[] { typeName, xsdElement.getName() },
- this,
- this.qName.getNameTextRange(astRoot)));
- }
- }
-
-
- protected class XmlElementQName
- extends AbstractJavaElementQName {
-
- protected XmlElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return GenericJavaXmlElement.this.getPersistentAttribute();
- }
-
- @Override
- protected XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElement.this.context.getElementWrapper();
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElement.this.getAnnotation(createIfNull);
- }
- }
-
-
- public interface Context {
-
- JaxbAttributeMapping getAttributeMapping();
-
- XmlElementAnnotation getAnnotation(boolean createIfNull);
-
- String getDefaultType();
-
- XmlElementWrapper getElementWrapper();
-
- boolean hasXmlID();
-
- boolean hasXmlIDREF();
-
- boolean hasXmlList();
-
- boolean hasXmlSchemaType();
-
- XmlSchemaType getXmlSchemaType();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java
deleted file mode 100644
index 75aae25adc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementMapping
- extends AbstractJavaXmlNamedNodeMapping<XmlElementAnnotation>
- implements XmlElementMapping {
-
- protected final XmlElement xmlElement;
-
- protected XmlElementWrapper xmlElementWrapper;
-
-
- public GenericJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElement = buildXmlElement();
- initializeXmlElementWrapper();
- }
-
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElement.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElement.update();
- updateXmlElementWrapper();
- }
-
-
- // ***** XmlElement *****
-
- public XmlElement getXmlElement() {
- return this.xmlElement;
- }
-
- protected XmlElement buildXmlElement() {
- return new GenericJavaXmlElement(this, new XmlElementContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (getXmlElementWrapper() != null) {
- getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (getXmlElementWrapper() != null) {
- getXmlElementWrapper().update();
- }
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
-
- // ***** XmlList *****
-
- @Override
- protected boolean calculateDefaultXmlList() {
- return false;
- }
-
-
- // ***** XmlIDREF *****
-
- @Override
- protected GenericJavaXmlIDREF.Context buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getReferencedXmlTypeNames(),
- this.xmlElement.getReferencedXmlTypeNames());
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
- public XsdFeature getXsdFeature() {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType != null) {
- XmlElementWrapper elementWrapper = this.xmlElementWrapper;
-
- if (elementWrapper == null) {
- return xsdType.getElement(this.xmlElement.getQName().getNamespace(), this.xmlElement.getQName().getName());
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement != null) {
- return xsdWrapperElement.getElement(this.xmlElement.getQName().getNamespace(), this.xmlElement.getQName().getName());
- }
- }
- }
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElement.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected class XmlElementContext
- implements GenericJavaXmlElement.Context {
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- return (createIfNull) ?
- GenericJavaXmlElementMapping.this.getOrCreateAnnotation()
- : GenericJavaXmlElementMapping.this.getAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementMapping.this;
- }
-
- public String getDefaultType() {
- return GenericJavaXmlElementMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementMapping.this.getXmlElementWrapper();
- }
-
- public boolean hasXmlID() {
- return GenericJavaXmlElementMapping.this.getXmlID() != null;
- }
-
- public boolean hasXmlIDREF() {
- return GenericJavaXmlElementMapping.this.getXmlIDREF() != null;
- }
-
- public boolean hasXmlList() {
- return GenericJavaXmlElementMapping.this.isXmlList();
- }
-
- public boolean hasXmlSchemaType() {
- return getXmlSchemaType() != null;
- }
-
- public XmlSchemaType getXmlSchemaType() {
- return GenericJavaXmlElementMapping.this.getXmlSchemaType();
- }
- }
-
-
- protected class XmlIDREFContext
- extends AbstractJavaXmlNamedNodeMapping.XmlIDREFContext {
-
- public Iterable<ValidatableReference> getReferences() {
-
- return new SingleElementIterable<ValidatableReference>(
-
- new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return GenericJavaXmlElementMapping.this.xmlElement.getType();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- // 1) if we're getting here, XmlIDREF will not be null
- // 2) if there is an @XmlElement annotation, use that, otherwise use the @XmlIDREF
- return (GenericJavaXmlElementMapping.this.getAnnotation() == null) ?
- GenericJavaXmlElementMapping.this.getXmlIDREF().getValidationTextRange(astRoot)
- : GenericJavaXmlElementMapping.this.xmlElement.getTypeTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return GenericJavaXmlElementMapping.this.getXsdFeature();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return GenericJavaXmlElementMapping.this.xmlElement.getQName().getNameTextRange(astRoot);
- }
- });
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
deleted file mode 100644
index 9141e40481..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRef
- extends AbstractJavaContextNode
- implements XmlElementRef {
-
- protected final Context context;
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- public GenericJavaXmlElementRef(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedType = buildSpecifiedType();
- this.defaultType = buildDefaultType();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- setSpecifiedType_(buildSpecifiedType());
- setDefaultType_(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- protected Context getContext() {
- return this.context;
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getContext().getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlElementRefQName(this);
- }
-
-
- // ***** XmlElementRef.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation().setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- return getAnnotation().getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlElementRef.type *****
-
- public String getType() {
- return (this.specifiedType == null) ? getDefaultType() : this.specifiedType;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- getAnnotation().setType(newSpecifiedType);
- setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- return getAnnotation().getType();
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(String newType) {
- String oldType = this.defaultType;
- this.defaultType = newType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldType, newType);
- }
-
- protected String buildDefaultType() {
- return this.context.getDefaultType();
- }
-
- public String getFullyQualifiedType() {
- return (this.specifiedType == null) ? getDefaultType() : getAnnotation().getFullyQualifiedTypeName();
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- // only return the specified type - the default type should already be included
- if (this.specifiedType != null
- && ! isTypeJAXBElement()) {
- return new SingleElementIterable(getFullyQualifiedType());
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean isTypeJAXBElement() {
- return (StringTools.stringsAreEqual(JAXB.JAXB_ELEMENT, getFullyQualifiedType()));
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTypeTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
- }
-
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- String fqType = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__UNSPECIFIED_TYPE,
- this,
- getTypeTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(this.specifiedType)
- // verify that type actually exists before validating
- && JDTTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
- String attributeValueType = getContext().getAttributeMapping().getValueTypeName();
- if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeValueType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__ILLEGAL_TYPE,
- new String[] { attributeValueType },
- this,
- getTypeTextRange(astRoot)));
-
- }
-
- // if type is a persistent class, check that it or a subclass has a root element specified
- JaxbTypeMapping typeMapping = getJaxbProject().getContextRoot().getTypeMapping(fqType);
- if (typeMapping != null && ! typeMapping.hasRootElementInHierarchy()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_ROOT_ELEMENT,
- new String[] { attributeValueType },
- this,
- getTypeTextRange(astRoot)));
- }
- }
- }
-
-
- protected class XmlElementRefQName
- extends AbstractJavaElementQName {
-
- protected XmlElementRefQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return GenericJavaXmlElementRef.this.getPersistentAttribute();
- }
-
- protected boolean isTypeJAXBElement() {
- return GenericJavaXmlElementRef.this.isTypeJAXBElement();
- }
-
- protected JaxbTypeMapping getReferencedTypeMapping() {
- String fqTypeName = GenericJavaXmlElementRef.this.getFullyQualifiedType();
- return getJaxbProject().getContextRoot().getTypeMapping(fqTypeName);
- }
-
- @Override
- protected XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRef.this.context.getElementWrapper();
- }
-
- @Override
- public String getDefaultName() {
- if (isTypeJAXBElement()) {
- return super.getDefaultName();
- }
-
- JaxbTypeMapping referencedTypeMapping = getReferencedTypeMapping();
- if (referencedTypeMapping != null) {
- XmlRootElement rootElement = referencedTypeMapping.getXmlRootElement();
- if (rootElement != null) {
- return rootElement.getQName().getName();
- }
- }
-
- return "";
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbTypeMapping referencedTypeMapping = getReferencedTypeMapping();
- if (referencedTypeMapping != null) {
- XmlRootElement rootElement = referencedTypeMapping.getXmlRootElement();
- if (rootElement != null) {
- return rootElement.getQName().getNamespace();
- }
- }
-
- return super.getDefaultNamespace();
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // only validate if type is JAXBElement
- if (isTypeJAXBElement()) {
- super.validateName(messages, reporter, astRoot);
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validateReference(messages, reporter, astRoot);
-
- // if type is JAXBElement, then name/namespace must also point at a valid XmlElementDecl
- if (! isTypeJAXBElement()) {
- return;
- }
-
- XmlRegistry registry = getJaxbPackage().getRegistry();
-
- if (registry == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_REGISTRY,
- this,
- getValidationTextRange(astRoot)));
- return;
- }
-
- for (JaxbElementFactoryMethod elementDecl : registry.getElementFactoryMethods()) {
- if (Tools.valuesAreEqual(getName(), elementDecl.getQName().getName())
- && Tools.valuesAreEqual(getNamespace(), elementDecl.getQName().getNamespace())) {
- return;
- }
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL,
- new String[] { getNamespace(), getName() },
- this,
- getValidationTextRange(astRoot)));
-
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElementRef.this.getAnnotation();
- }
- }
-
-
- public interface Context {
-
- JaxbAttributeMapping getAttributeMapping();
-
- XmlElementRefAnnotation getAnnotation();
-
- String getDefaultType();
-
- XmlElementWrapper getElementWrapper();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java
deleted file mode 100644
index 9362158238..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementRefAnnotation>
- implements XmlElementRefMapping {
-
- protected final XmlElementRef xmlElementRef;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementRef = buildXmlElementRef();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRef.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRef.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** XmlElementRef *****
-
- public XmlElementRef getXmlElementRef() {
- return this.xmlElementRef;
- }
-
- protected XmlElementRef buildXmlElementRef() {
- return new GenericJavaXmlElementRef(this, new XmlElementRefContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRef.getReferencedXmlTypeNames();
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRef.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRef.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
- }
-
-
- public class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- public XmlElementRefAnnotation getAnnotation() {
- return GenericJavaXmlElementRefMapping.this.getAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementRefMapping.this;
- }
-
- public String getDefaultType() {
- return GenericJavaXmlElementRefMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRefMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
deleted file mode 100644
index c7e0f48e47..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefs
- extends AbstractJavaContextNode
- implements XmlElementRefs {
-
- protected final Context context;
-
- protected final ContextListContainer<XmlElementRef, XmlElementRefAnnotation> xmlElementRefContainer;
-
-
- public GenericJavaXmlElementRefs(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.xmlElementRefContainer = this.buildXmlElementRefContainer();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRefContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefContainer.update();
- }
-
-
- // ***** xml element refs *****
-
- public ListIterable<XmlElementRef> getXmlElementRefs() {
- return this.xmlElementRefContainer.getContextElements();
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefContainer.getContextElementsSize();
- }
-
- public XmlElementRef addXmlElementRef(int index) {
- XmlElementRefAnnotation annotation = this.context.addXmlElementRefAnnotation(index);
- return this.xmlElementRefContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlElementRef(int index) {
- this.context.removeXmlElementRefAnnotation(index);
- this.xmlElementRefContainer.removeContextElement(index);
- }
-
- public void removeXmlElementRef(XmlElementRef xmlElementRef) {
- removeXmlElementRef(this.xmlElementRefContainer.indexOfContextElement(xmlElementRef));
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- this.context.moveXmlElementRefAnnotation(targetIndex, sourceIndex);
- this.xmlElementRefContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlElementRef buildXmlElementRef(XmlElementRefAnnotation xmlElementRefAnnotation) {
- return this.context.buildXmlElementRef(this, xmlElementRefAnnotation);
- }
-
- protected ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- return this.context.getXmlElementRefAnnotations();
- }
-
- protected ContextListContainer<XmlElementRef, XmlElementRefAnnotation> buildXmlElementRefContainer() {
- XmlElementRefContainer container = new XmlElementRefContainer();
- container.initialize();
- return container;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (XmlElementRef elementRef : getXmlElementRefs()) {
- result = elementRef.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateTypesAndQNames(messages, reporter, astRoot);
-
- for (XmlElementRef elementRef : getXmlElementRefs()) {
- elementRef.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- Bag<String> xmlElementRefTypes = new HashBag<String>();
- Bag<QName> xmlElementRefQnames = new HashBag<QName>();
-
- for (XmlElementRef xmlElementRef : getXmlElementRefs()) {
- String typeName = xmlElementRef.getFullyQualifiedType();
- boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName);
- if (! isJaxbElement && ! StringTools.stringIsEmpty(typeName)) {
- xmlElementRefTypes.add(typeName);
- }
- String elementRefName = xmlElementRef.getQName().getName();
- if (isJaxbElement && ! StringTools.stringIsEmpty(elementRefName)) {
- xmlElementRefQnames.add(new QName(xmlElementRef.getQName().getNamespace(), elementRefName));
- }
- }
-
- for (XmlElementRef xmlElementRef : getXmlElementRefs()) {
- String typeName = xmlElementRef.getFullyQualifiedType();
- boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName);
- if (! isJaxbElement && xmlElementRefTypes.count(typeName) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE,
- new String[] { typeName },
- xmlElementRef,
- xmlElementRef.getTypeTextRange(astRoot)));
- }
-
- String xmlElementNamespace = xmlElementRef.getQName().getNamespace();
- String xmlElementName = xmlElementRef.getQName().getName();
- if (isJaxbElement && xmlElementRefQnames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName },
- xmlElementRef,
- xmlElementRef.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- new TransformationIterable<XmlElementRef, Iterable<String>>(getXmlElementRefs()) {
- @Override
- protected Iterable<String> transform(XmlElementRef xmlElementRef) {
- return xmlElementRef.getReferencedXmlTypeNames();
- }
- });
- }
-
-
-
- protected class XmlElementRefContainer
- extends ContextListContainer<XmlElementRef, XmlElementRefAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlElementRefs.XML_ELEMENT_REFS_LIST;
- }
-
- @Override
- protected XmlElementRef buildContextElement(XmlElementRefAnnotation resourceElement) {
- return GenericJavaXmlElementRefs.this.buildXmlElementRef(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlElementRefAnnotation> getResourceElements() {
- return GenericJavaXmlElementRefs.this.getXmlElementRefAnnotations();
- }
-
- @Override
- protected XmlElementRefAnnotation getResourceElement(XmlElementRef contextElement) {
- // in this context, there will never be an XmlElementRef without an annotation
- return contextElement.getAnnotation();
- }
- }
-
-
- public interface Context {
-
- ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations();
-
- XmlElementRefAnnotation addXmlElementRefAnnotation(int index);
-
- void removeXmlElementRefAnnotation(int index);
-
- void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex);
-
- XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation);
-
- TextRange getValidationTextRange(CompilationUnit astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java
deleted file mode 100644
index 48bbf2022c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefsMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementRefsAnnotation>
- implements XmlElementRefsMapping {
-
- protected final XmlElementRefs xmlElementRefs;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementRefs = buildXmlElementRefs();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRefs.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefs.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** XmlElementRefs *****
-
- public XmlElementRefs getXmlElementRefs() {
- return this.xmlElementRefs;
- }
-
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRefs.getReferencedXmlTypeNames();
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRefs.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRefs.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlMixed != null) {
- this.xmlMixed.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected class XmlElementRefsContext
- implements GenericJavaXmlElementRefs.Context {
-
- protected XmlElementRefsAnnotation getXmlElementRefsAnnotation() {
- return GenericJavaXmlElementRefsMapping.this.getAnnotation();
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- return getXmlElementRefsAnnotation().getXmlElementRefs();
- }
-
- public XmlElementRefAnnotation addXmlElementRefAnnotation(int index) {
- return getXmlElementRefsAnnotation().addXmlElementRef(index);
- }
-
- public void removeXmlElementRefAnnotation(int index) {
- getXmlElementRefsAnnotation().removeXmlElementRef(index);
- }
-
- public void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex) {
- getXmlElementRefsAnnotation().moveXmlElementRef(targetIndex, sourceIndex);
- }
-
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlElementRefsAnnotation().getTextRange(astRoot);
- }
- }
-
-
- protected class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- protected XmlElementRefAnnotation annotation;
-
- public XmlElementRefContext(XmlElementRefAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementRefsMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRefsMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
deleted file mode 100644
index 23f7c5aa00..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementWrapper
- extends AbstractJavaContextNode
- implements XmlElementWrapper {
-
- protected final Context context;
-
- protected JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
- protected Boolean specifiedNillable;
-
-
- public GenericJavaXmlElementWrapper(JaxbAttributeMapping parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedNillable = this.buildSpecifiedNillable();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlElementQName(this);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- protected XmlElementWrapperAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- this.setSpecifiedNillable_(this.buildSpecifiedNillable());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- //************ XmlElementWrapper.required ***************
-
- public boolean isRequired() {
- return (this.getSpecifiedRequired() == null) ? this.isDefaultRequired() : this.getSpecifiedRequired().booleanValue();
- }
-
- public boolean isDefaultRequired() {
- return DEFAULT_REQUIRED;
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation().setRequired(newSpecifiedRequired);
- this.setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- return getAnnotation().getRequired();
- }
-
-
- //************ XmlElementWrapper.nillable ***************
-
- public boolean isNillable() {
- return (this.getSpecifiedNillable() == null) ? this.isDefaultNillable() : this.getSpecifiedNillable().booleanValue();
- }
-
- public boolean isDefaultNillable() {
- return DEFAULT_NILLABLE;
- }
-
- public Boolean getSpecifiedNillable() {
- return this.specifiedNillable;
- }
-
- public void setSpecifiedNillable(Boolean newSpecifiedNillable) {
- getAnnotation().setNillable(newSpecifiedNillable);
- this.setSpecifiedNillable_(newSpecifiedNillable);
- }
-
- protected void setSpecifiedNillable_(Boolean newSpecifiedNillable) {
- Boolean oldNillable = this.specifiedNillable;
- this.specifiedNillable = newSpecifiedNillable;
- firePropertyChanged(SPECIFIED_NILLABLE_PROPERTY, oldNillable, newSpecifiedNillable);
- }
-
- protected Boolean buildSpecifiedNillable() {
- return getAnnotation().getNillable();
- }
-
-
- // **************** misc **************************************************
-
- public XsdElementDeclaration getXsdElementDeclaration() {
- XsdTypeDefinition xsdType = getPersistentAttribute().getClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName());
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
-
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION,
- this,
- getValidationTextRange(astRoot)));
- }
-
- validateQName(messages, reporter, astRoot);
- }
-
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.qName.validate(messages, reporter, astRoot);
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
-
- public interface Context {
-
- /**
- * This should never be null
- */
- XmlElementWrapperAnnotation getAnnotation();
- }
-
-
- public static class SimpleContext
- implements Context {
-
- protected XmlElementWrapperAnnotation annotation;
-
- public SimpleContext(XmlElementWrapperAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementWrapperAnnotation getAnnotation() {
- return this.annotation;
- }
- }
-
-
- protected class XmlElementQName
- extends AbstractJavaQName {
-
- protected XmlElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlElementWrapper.this.getJaxbPackage();
- }
-
- @Override
- public String getDefaultName() {
- return "";
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage != null && jaxbPackage.getElementFormDefault() == XmlNsForm.QUALIFIED) ?
- GenericJavaXmlElementWrapper.this.getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = GenericJavaXmlElementWrapper.this.getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? EmptyIterable.instance() : xsdType.getElementNameProposals(getNamespace(), filter);
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type == null) {
- return;
- }
-
- if (type.getElement(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElementWrapper.this.getAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java
deleted file mode 100644
index 993b48d308..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementsMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementsAnnotation>
- implements XmlElementsMapping {
-
- protected final ContextListContainer<XmlElement, XmlElementAnnotation> xmlElementContainer;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlIDREF xmlIDREF;
-
-
- public GenericJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementContainer = buildXmlElementContainer();
- initializeXmlElementWrapper();
- initializeXmlIDREF();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementContainer.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlIDREF();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementContainer.update();
- updateXmlElementWrapper();
- updateXmlIDREF();
- }
-
-
- // ***** xml elements *****
-
- public ListIterable<XmlElement> getXmlElements() {
- return this.xmlElementContainer.getContextElements();
- }
-
- public int getXmlElementsSize() {
- return this.xmlElementContainer.getContextElementsSize();
- }
-
- public XmlElement addXmlElement(int index) {
- XmlElementAnnotation annotation = getAnnotation().addXmlElement(index);
- return this.xmlElementContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlElement(int index) {
- getAnnotation().removeXmlElement(index);
- this.xmlElementContainer.removeContextElement(index);
- }
-
- public void removeXmlElement(XmlElement xmlElement) {
- removeXmlElement(this.xmlElementContainer.indexOfContextElement(xmlElement));
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- getAnnotation().moveXmlElement(targetIndex, sourceIndex);
- this.xmlElementContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlElement buildXmlElement(XmlElementAnnotation xmlElementAnnotation) {
- return new GenericJavaXmlElement(this, new XmlElementContext(xmlElementAnnotation));
- }
-
- protected ListIterable<XmlElementAnnotation> getXmlElementAnnotations() {
- return getAnnotation().getXmlElements();
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
- protected ContextListContainer<XmlElement, XmlElementAnnotation> buildXmlElementContainer() {
- XmlElementContainer container = new XmlElementContainer();
- container.initialize();
- return container;
- }
-
-
- // ***** XmlIDREF *****
-
- public XmlIDREF getXmlIDREF() {
- return this.xmlIDREF;
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_IDREF);
- XmlIDREF xmlIDREF = buildXmlIDREF();
- setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_IDREF);
- setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- if (getXmlIDREFAnnotation() != null) {
- this.xmlIDREF = buildXmlIDREF();
- }
- }
-
- protected void syncXmlIDREF() {
- if (getXmlIDREFAnnotation() == null) {
- setXmlIDREF_(null);
- }
- else if (this.xmlIDREF == null) {
- setXmlIDREF_(buildXmlIDREF());
- }
- else {
- this.xmlIDREF.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.xmlIDREF != null) {
- this.xmlIDREF.update();
- }
- }
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_IDREF);
- }
-
- protected XmlIDREF buildXmlIDREF() {
- return new GenericJavaXmlIDREF(this, buildXmlIDREFContext());
- }
-
- protected XmlIDREFContext buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getReferencedXmlTypeNames(),
- new CompositeIterable<String>(
- new TransformationIterable<XmlElement, Iterable<String>>(getXmlElements()) {
- @Override
- protected Iterable<String> transform(XmlElement o) {
- return o.getReferencedXmlTypeNames();
- }
- }));
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (XmlElement xmlElement : getXmlElements()) {
- result = xmlElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateTypesAndQNames(messages, reporter, astRoot);
-
- for (XmlElement xmlElement : getXmlElements()) {
- xmlElement.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlIDREF != null) {
- this.xmlIDREF.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- Bag<String> xmlElementTypes = new HashBag<String>();
- Bag<QName> xmlElementQNames = new HashBag<QName>();
-
- for (XmlElement xmlElement : getXmlElements()) {
- String typeName = xmlElement.getFullyQualifiedType();
- if (! StringTools.stringIsEmpty(typeName)) {
- xmlElementTypes.add(typeName);
- }
- String elementName = xmlElement.getQName().getName();
- if (! StringTools.stringIsEmpty(elementName)) {
- xmlElementQNames.add(new QName(xmlElement.getQName().getNamespace(), elementName));
- }
- }
-
- for (XmlElement xmlElement : getXmlElements()) {
- validateDuplicateType(xmlElement, xmlElementTypes, messages, astRoot);
- validateDuplicateQName(xmlElement, xmlElementQNames, messages, astRoot);
- }
- }
-
- protected void validateDuplicateType(XmlElement xmlElement, Bag<String> xmlElementTypes,
- List<IMessage> messages, CompilationUnit astRoot) {
- String xmlElementType = xmlElement.getFullyQualifiedType();
- if (xmlElementTypes.count(xmlElementType) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE,
- new String[] { xmlElementType },
- xmlElement,
- xmlElement.getTypeTextRange(astRoot)));
- }
- }
-
- protected void validateDuplicateQName(XmlElement xmlElement, Bag<QName> xmlElementQNames,
- List<IMessage> messages, CompilationUnit astRoot) {
- String xmlElementNamespace = xmlElement.getQName().getNamespace();
- String xmlElementName = xmlElement.getQName().getName();
- if (xmlElementQNames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName },
- xmlElement,
- xmlElement.getQName().getNameTextRange(astRoot)));
- }
- }
-
- protected class XmlElementContainer
- extends ContextListContainer<XmlElement, XmlElementAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlElementsMapping.XML_ELEMENTS_LIST;
- }
-
- @Override
- protected XmlElement buildContextElement(XmlElementAnnotation resourceElement) {
- return GenericJavaXmlElementsMapping.this.buildXmlElement(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlElementAnnotation> getResourceElements() {
- return GenericJavaXmlElementsMapping.this.getXmlElementAnnotations();
- }
-
- @Override
- protected XmlElementAnnotation getResourceElement(XmlElement contextElement) {
- // in the context of this mapping, there will never be an XmlElement without an annotation
- return contextElement.getAnnotation(false);
- }
- }
-
-
- protected class XmlElementContext
- implements GenericJavaXmlElement.Context {
-
- protected XmlElementAnnotation annotation;
-
- protected XmlElementContext(XmlElementAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- // will never be null in this context
- return annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementsMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementsMapping.this.getXmlElementWrapper();
- }
-
- public boolean hasXmlID() {
- return false;
- }
-
- public boolean hasXmlIDREF() {
- return GenericJavaXmlElementsMapping.this.getXmlIDREF() != null;
- }
-
- public boolean hasXmlList() {
- return false;
- }
-
- public boolean hasXmlSchemaType() {
- return false;
- }
-
- public XmlSchemaType getXmlSchemaType() {
- return null;
- }
- }
-
-
- protected class XmlIDREFContext
- implements GenericJavaXmlIDREF.Context {
-
- public XmlIDREFAnnotation getAnnotation() {
- return GenericJavaXmlElementsMapping.this.getXmlIDREFAnnotation();
- }
-
- public Iterable<ValidatableReference> getReferences() {
- return new TransformationIterable<XmlElement, ValidatableReference>(
- GenericJavaXmlElementsMapping.this.getXmlElements()) {
-
- @Override
- protected ValidatableReference transform(final XmlElement o) {
-
- return new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return o.getFullyQualifiedType();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return o.getTypeTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return o.getXsdElement();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return o.getQName().getNameTextRange(astRoot);
- }
- };
- }
- };
- }
-
- public boolean isList() {
- return false;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java
deleted file mode 100644
index c9b039ad82..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlID
- extends AbstractJavaContextNode
- implements XmlID
-{
-
- protected final XmlIDAnnotation resourceXmlID;
-
- public GenericJavaXmlID(XmlNamedNodeMapping parent, XmlIDAnnotation resource) {
- super(parent);
- this.resourceXmlID = resource;
- }
-
-
- public XmlNamedNodeMapping getMapping() {
- return (XmlNamedNodeMapping) getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getMapping().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateAttributeType(messages, astRoot);
-
- XsdFeature xsdFeature = getMapping().getXsdFeature();
- if (xsdFeature == null) {
- return;
- }
-
- XsdTypeDefinition idrefType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID");
- if (! xsdFeature.typeIsValid(idrefType, false)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__SCHEMA_TYPE_NOT_ID,
- new String [] { xsdFeature.getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) {
- if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(String.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__ATTRIBUTE_TYPE_NOT_STRING,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlID.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
deleted file mode 100644
index 903a8ead21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlIDREF
- extends AbstractJavaContextNode
- implements XmlIDREF {
-
- protected final Context context;
-
-
- public GenericJavaXmlIDREF(JaxbAttributeMapping parent, Context context) {
- super(parent);
- this.context = context;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- for (ValidatableReference ref : this.context.getReferences()) {
- String typeName = ref.getFullyQualifiedType();
-
- // Object may be used in some cases of a *single* type, but can't be validated
- if (! (Object.class.getName().equals(typeName) && CollectionTools.size(this.context.getReferences()) == 1)) {
-
- JaxbClassMapping classMapping = getContextRoot().getClassMapping(typeName);
- if (classMapping == null || classMapping.getXmlIdMapping() == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID,
- new String[] { typeName },
- this,
- ref.getTypeTextRange(astRoot)));
- }
- }
-
- XsdFeature xsdFeature = ref.getXsdFeature();
- if (xsdFeature == null) {
- return;
- }
- if (xsdFeature != null
- && ! xsdFeature.typeIsValid(XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF"), this.context.isList())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID_REF__SCHEMA_TYPE_NOT_IDREF,
- new String [] { xsdFeature.getName() },
- this,
- ref.getXsdFeatureTextRange(astRoot)));
- }
- }
- }
-
-
- public interface Context {
-
- XmlIDREFAnnotation getAnnotation();
-
- Iterable<ValidatableReference> getReferences();
-
- boolean isList();
- }
-
-
- public interface ValidatableReference {
-
- String getFullyQualifiedType();
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- XsdFeature getXsdFeature();
-
- TextRange getXsdFeatureTextRange(CompilationUnit astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
deleted file mode 100644
index 4898ebd157..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-public class GenericJavaXmlMixed
- extends AbstractJavaContextNode
- implements XmlMixed {
-
- protected final XmlMixedAnnotation resourceXmlMixed;
-
-
- public GenericJavaXmlMixed(JaxbAttributeMapping parent, XmlMixedAnnotation resource) {
- super(parent);
- this.resourceXmlMixed = resource;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlMixed.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
deleted file mode 100644
index d317dffb14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-public class GenericJavaXmlNs
- extends AbstractJavaContextNode
- implements XmlNs {
-
- protected final XmlNsAnnotation resourceXmlNs;
-
- protected String namespaceURI;
-
- protected String prefix;
-
-
- public GenericJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- super(parent);
- this.resourceXmlNs = xmlNsAnnotation;
- this.namespaceURI = this.getResourceNamespaceURI();
- this.prefix = this.getResourcePrefix();
- }
-
-
- public XmlNsAnnotation getResourceXmlNs() {
- return this.resourceXmlNs;
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setNamespaceURI_(this.getResourceNamespaceURI());
- this.setPrefix_(this.getResourcePrefix());
- }
-
-
- protected JaxbPackageInfo getJaxbPackageInfo() {
- return getXmlSchema().getJaxbPackageInfo();
- }
-
- protected XmlSchema getXmlSchema() {
- return (XmlSchema) getParent();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getJaxbPackageInfo().getResourcePackage();
- }
-
-
- // ***** namespaceURI *****
-
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- public void setNamespaceURI(String namespace) {
- this.resourceXmlNs.setNamespaceURI(namespace);
- this.setNamespaceURI_(namespace);
- }
-
- protected void setNamespaceURI_(String namespaceURI) {
- String old = this.namespaceURI;
- this.namespaceURI = namespaceURI;
- this.firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
- }
-
- protected String getResourceNamespaceURI() {
- return this.resourceXmlNs.getNamespaceURI();
- }
-
-
- // ***** prefix *****
-
- public String getPrefix() {
- return this.prefix;
- }
-
- public void setPrefix(String prefix) {
- this.resourceXmlNs.setPrefix(prefix);
- this.setPrefix_(prefix);
- }
-
- protected void setPrefix_(String prefix) {
- String old = this.prefix;
- this.prefix = prefix;
- this.firePropertyChanged(PREFIX_PROPERTY, old, prefix);
- }
-
- protected String getResourcePrefix() {
- return this.resourceXmlNs.getPrefix();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- if (getResourceXmlNs().namespaceURITouches(pos, astRoot)) {
- return getNamespaceURICompletionProposals(pos, filter, astRoot);
- }
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getNamespaceURICompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- String packageNamespace = getJaxbPackageInfo().getJaxbPackage().getNamespace();
- Iterable<String> result = (StringTools.stringIsEmpty(packageNamespace)) ?
- EmptyIterable.instance() : new SingleElementIterable(StringTools.convertToJavaStringLiteral(packageNamespace));
- XsdSchema schema = getJaxbPackageInfo().getJaxbPackage().getXsdSchema();
- if (schema != null) {
- result = new CompositeIterable<String>(result, schema.getNamespaceProposals(filter));
- }
- return CollectionTools.set(result);
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceXmlNs().getTextRange(astRoot);
- }
-
-
- // ***** miscellaneous *****
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.namespaceURI);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java
deleted file mode 100644
index 2a69368779..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlRegistry
- extends AbstractJavaContextNode
- implements XmlRegistry {
-
- protected final ElementFactoryMethodContainer elementFactoryMethodContainer;
-
-
- public GenericJavaXmlRegistry(JaxbClass parent) {
- super(parent);
- this.elementFactoryMethodContainer = new ElementFactoryMethodContainer();
-
- initElementFactoryMethods();
- }
-
-
- public JaxbClass getJaxbClass() {
- return (JaxbClass) getParent();
- }
-
- public JavaResourceType getJavaResourceType() {
- return getJaxbClass().getJavaResourceType();
- }
-
- protected XmlRegistryAnnotation getAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_REGISTRY);
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbClass().getJaxbPackage();
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncElementFactoryMethods();
- }
-
- @Override
- public void update() {
- super.update();
- updateElementFactoryMethods();
- }
-
-
- // ***** element factory methods *****
-
- public Iterable<JaxbElementFactoryMethod> getElementFactoryMethods() {
- return this.elementFactoryMethodContainer.getContextElements();
- }
-
- public int getElementFactoryMethodsSize() {
- return this.elementFactoryMethodContainer.getContextElementsSize();
- }
-
- protected void initElementFactoryMethods() {
- this.elementFactoryMethodContainer.initialize();
- }
-
- protected void syncElementFactoryMethods() {
- this.elementFactoryMethodContainer.synchronizeWithResourceModel();
- }
-
- protected void updateElementFactoryMethods() {
- this.elementFactoryMethodContainer.update();
- }
-
- private JaxbElementFactoryMethod buildElementFactoryMethod(JavaResourceMethod resourceMethod) {
- return getFactory().buildJavaElementFactoryMethod(this, resourceMethod);
- }
-
- private Iterable<JavaResourceMethod> getResourceElementFactoryMethods() {
- return new FilteringIterable<JavaResourceMethod>(getJavaResourceType().getMethods()) {
- @Override
- protected boolean accept(JavaResourceMethod method) {
- return methodIsElementFactoryMethod(method);
- }
- };
- }
-
- // Return methods with XmlElementDecl annotation
- protected static boolean methodIsElementFactoryMethod(JavaResourceMethod method) {
- return methodHasXmlElementDeclAnnotation(method);
- }
-
- protected static boolean methodHasXmlElementDeclAnnotation(JavaResourceMethod method) {
- return method.getAnnotation(JAXB.XML_ELEMENT_DECL) != null;
- }
-
- protected static boolean methodReturnTypeIsJAXBElement(JavaResourceMethod method) {
- return method.typeIsSubTypeOf(JAXB.XML_ELEMENT);
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) {
- result = efm.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.<String>instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : getJaxbClass().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(getJaxbPackage());
- if (CollectionTools.size(registries) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE,
- this,
- getValidationTextRange(astRoot)));
- }
-
- validateDuplicateQNames(messages, reporter, astRoot);
-
- for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) {
- efm.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- Map<String, Bag<QName>> xmlElementDeclQnames = new HashMap<String, Bag<QName>>();
-
- for (JaxbElementFactoryMethod xmlElementDecl : getElementFactoryMethods()) {
- String elementDeclName = xmlElementDecl.getQName().getName();
- if (! StringTools.stringIsEmpty(elementDeclName)) {
- String fqScope = xmlElementDecl.getFullyQualifiedScope();
- if (xmlElementDeclQnames.get(fqScope) == null) {
- xmlElementDeclQnames.put(fqScope, new HashBag<QName>());
- }
- xmlElementDeclQnames.get(fqScope).add(new QName(xmlElementDecl.getQName().getNamespace(), elementDeclName));
- }
- }
-
- for (JaxbElementFactoryMethod xmlElementDecl : getElementFactoryMethods()) {
- String fqScope = xmlElementDecl.getFullyQualifiedScope();
- String xmlElementNamespace = xmlElementDecl.getQName().getNamespace();
- String xmlElementName = xmlElementDecl.getQName().getName();
- if (xmlElementDeclQnames.get(fqScope).count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- String scopeDesc = "";
- if (! JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME.equals(fqScope)) {
- scopeDesc = NLS.bind(JptJaxbCoreMessages.XML_ELEMENT_DECL__SCOPE, fqScope);
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName, scopeDesc },
- xmlElementDecl,
- xmlElementDecl.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
- /**
- * element factory method container adapter
- */
- protected class ElementFactoryMethodContainer
- extends ContextCollectionContainer<JaxbElementFactoryMethod, JavaResourceMethod> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlRegistry.ELEMENT_FACTORY_METHODS_COLLECTION;
- }
-
- @Override
- protected JaxbElementFactoryMethod buildContextElement(JavaResourceMethod resourceElement) {
- return GenericJavaXmlRegistry.this.buildElementFactoryMethod(resourceElement);
- }
-
- @Override
- protected Iterable<JavaResourceMethod> getResourceElements() {
- return GenericJavaXmlRegistry.this.getResourceElementFactoryMethods();
- }
-
- @Override
- protected JavaResourceMethod getResourceElement(JaxbElementFactoryMethod contextElement) {
- return contextElement.getResourceMethod();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
deleted file mode 100644
index 5147639f89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlRootElement
- extends AbstractJavaContextNode
- implements XmlRootElement {
-
- protected final XmlRootElementAnnotation annotation;
-
- protected JaxbQName qName;
-
-
- public GenericJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation resourceXmlRootElementAnnotation) {
- super(parent);
- this.annotation = resourceXmlRootElementAnnotation;
- this.qName = buildQName();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlRootElementQName(this);
- }
-
- public JaxbTypeMapping getTypeMapping() {
- return (JaxbTypeMapping) getParent();
- }
-
- protected JaxbType getJaxbType() {
- return getTypeMapping().getJaxbType();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbType().getJaxbPackage();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ***** schema element ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
- }
-
-
- //****************** miscellaneous ********************
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.qName.toString());
- }
-
-
- protected class XmlRootElementQName
- extends AbstractJavaQName {
-
- protected XmlRootElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlRootElement.this.getJaxbPackage();
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public String getDefaultName() {
- return Introspector.decapitalize(GenericJavaXmlRootElement.this.getJaxbType().getSimpleName());
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getElementNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String name = getName();
- String namespace = getNamespace();
- XsdSchema schema = this.getXsdSchema();
-
- if (schema != null) {
- // element must resolve
- XsdElementDeclaration schemaElement = schema.getElementDeclaration(namespace, name);
- if (schemaElement == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- else {
- // element type must agree with parent's schema type
- XsdTypeDefinition schemaType = GenericJavaXmlRootElement.this.getTypeMapping().getXsdTypeDefinition();
- if (schemaType != null) {
- if (! schemaType.equals(schemaElement.getType())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE,
- new String[] {name, namespace},
- this,
- getValidationTextRange(astRoot)));
- }
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlRootElement.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
deleted file mode 100644
index 3c7603548c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.XSDForm;
-
-public class GenericJavaXmlSchema
- extends AbstractJavaContextNode
- implements XmlSchema {
-
- protected String specifiedNamespace;
-
- protected String location;
-
- protected XmlNsForm specifiedAttributeFormDefault;
-
- protected XmlNsForm specifiedElementFormDefault;
-
- protected final ContextListContainer<XmlNs, XmlNsAnnotation> xmlNsPrefixContainer;
-
-
- public GenericJavaXmlSchema(JaxbPackageInfo parent) {
- super(parent);
- this.specifiedNamespace = this.getResourceNamespace();
- this.location = this.getResourceLocation();
- this.specifiedAttributeFormDefault = getResourceAttributeFormDefault();
- this.specifiedElementFormDefault = getResourceElementFormDefault();
- this.xmlNsPrefixContainer = this.buildXmlNsPrefixContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedNamespace_(this.getResourceNamespace());
- this.setLocation_(this.getResourceLocation());
- this.setSpecifiedAttributeFormDefault_(getResourceAttributeFormDefault());
- this.setSpecifiedElementFormDefault_(getResourceElementFormDefault());
- this.syncXmlNsPrefixes();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateXmlNsPrefixes();
- }
-
- public JaxbPackageInfo getJaxbPackageInfo() {
- return (JaxbPackageInfo) getParent();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbPackageInfo().getJaxbPackage();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getJaxbPackageInfo().getResourcePackage();
- }
-
-
- // ********** xml schema annotation **********
-
- protected XmlSchemaAnnotation getXmlSchemaAnnotation() {
- return (XmlSchemaAnnotation) this.getResourcePackage().getNonNullAnnotation(JAXB.XML_SCHEMA);
- }
-
- // ********** namespace **********
-
- public String getNamespace() {
- return (this.specifiedNamespace == null) ? "" : this.specifiedNamespace; //$NON-NLS-1$
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String namespace) {
- this.getXmlSchemaAnnotation().setNamespace(namespace);
- this.setSpecifiedNamespace_(namespace);
- }
-
- protected void setSpecifiedNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
- }
-
- protected String getResourceNamespace() {
- return getXmlSchemaAnnotation().getNamespace();
- }
-
-
- // ********** location **********
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- this.getXmlSchemaAnnotation().setLocation(location);
- this.setLocation_(location);
- }
-
- protected void setLocation_(String location) {
- String old = this.location;
- this.location = location;
- this.firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- protected String getResourceLocation() {
- return getXmlSchemaAnnotation().getLocation();
- }
-
-
- // ********** attribute form default **********
-
- public XmlNsForm getAttributeFormDefault() {
- return (this.specifiedAttributeFormDefault == null) ? XmlNsForm.UNSET : this.specifiedAttributeFormDefault;
- }
-
- public XmlNsForm getSpecifiedAttributeFormDefault() {
- return this.specifiedAttributeFormDefault;
- }
-
- public void setSpecifiedAttributeFormDefault(XmlNsForm attributeFormDefault) {
- getXmlSchemaAnnotation().setAttributeFormDefault(XmlNsForm.toJavaResourceModel(attributeFormDefault));
- setSpecifiedAttributeFormDefault_(attributeFormDefault);
- }
-
- protected void setSpecifiedAttributeFormDefault_(XmlNsForm attributeFormDefault) {
- XmlNsForm old = this.specifiedAttributeFormDefault;
- this.specifiedAttributeFormDefault = attributeFormDefault;
- firePropertyChanged(SPECIFIED_ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
- }
-
- protected XmlNsForm getResourceAttributeFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getAttributeFormDefault());
- }
-
-
- // ********** element form default **********
-
- public XmlNsForm getElementFormDefault() {
- return (this.specifiedElementFormDefault == null) ? XmlNsForm.UNSET : this.specifiedElementFormDefault;
- }
-
- public XmlNsForm getSpecifiedElementFormDefault() {
- return this.specifiedElementFormDefault;
- }
-
- public void setSpecifiedElementFormDefault(XmlNsForm elementFormDefault) {
- getXmlSchemaAnnotation().setElementFormDefault(XmlNsForm.toJavaResourceModel(elementFormDefault));
- setSpecifiedElementFormDefault_(elementFormDefault);
- }
-
- protected void setSpecifiedElementFormDefault_(XmlNsForm elementFormDefault) {
- XmlNsForm old = this.specifiedElementFormDefault;
- this.specifiedElementFormDefault = elementFormDefault;
- firePropertyChanged(SPECIFIED_ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
- }
-
- protected XmlNsForm getResourceElementFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getElementFormDefault());
- }
-
-
- // ********** xml namespace prefixes **********
-
- public ListIterable<XmlNs> getXmlNsPrefixes() {
- return this.xmlNsPrefixContainer.getContextElements();
- }
-
- public int getXmlNsPrefixesSize() {
- return this.xmlNsPrefixContainer.getContextElementsSize();
- }
-
- public XmlNs addXmlNsPrefix(int index) {
- XmlNsAnnotation annotation = this.getXmlSchemaAnnotation().addXmlns(index);
- return this.xmlNsPrefixContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlNsPrefix(XmlNs xmlNsPrefix) {
- this.removeXmlNsPrefix(this.xmlNsPrefixContainer.indexOfContextElement(xmlNsPrefix));
- }
-
- public void removeXmlNsPrefix(int index) {
- this.getXmlSchemaAnnotation().removeXmlns(index);
- this.xmlNsPrefixContainer.removeContextElement(index);
- }
-
- public void moveXmlNsPrefix(int targetIndex, int sourceIndex) {
- this.getXmlSchemaAnnotation().moveXmlns(targetIndex, sourceIndex);
- this.xmlNsPrefixContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlNs buildXmlNs(XmlNsAnnotation xmlNsAnnotation) {
- return this.getFactory().buildJavaXmlNs(this, xmlNsAnnotation);
- }
-
- protected void syncXmlNsPrefixes() {
- this.xmlNsPrefixContainer.synchronizeWithResourceModel();
- }
-
- protected void updateXmlNsPrefixes() {
- this.xmlNsPrefixContainer.update();
- }
-
- protected ListIterable<XmlNsAnnotation> getXmlNsAnnotations() {
- return getXmlSchemaAnnotation().getXmlns();
- }
-
- protected ContextListContainer<XmlNs, XmlNsAnnotation> buildXmlNsPrefixContainer() {
- XmlNsPrefixContainer container = new XmlNsPrefixContainer();
- container.initialize();
- return container;
- }
-
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (namespaceTouches(pos, astRoot)) {
- return getNamespaceProposals(filter);
- }
-
- for (XmlNs xmlns : getXmlNsPrefixes()) {
- result = xmlns.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().namespaceTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<SchemaEntry, String>(
- getJaxbProject().getSchemaLibrary().getSchemaEntries()) {
- @Override
- protected String transform(SchemaEntry o) {
- return o.getNamespace();
- }
- },
- filter));
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().getTextRange(astRoot);
- }
-
-
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // removing this validation message for now: see jaxb bug 823 (http://java.net/jira/browse/JAXB-823)
-// XsdSchema schema = getJaxbPackage().getXsdSchema();
-// if (schema != null) {
-// if (formConflicts(getAttributeFormDefault(), schema.getXSDComponent().getAttributeFormDefault())) {
-// messages.add(
-// DefaultValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// JaxbValidationMessages.XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT,
-// this,
-// getXmlSchemaAnnotation().getAttributeFormDefaultTextRange(astRoot)));
-// }
-//
-// if (formConflicts(getElementFormDefault(), schema.getXSDComponent().getElementFormDefault())) {
-// messages.add(
-// DefaultValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// JaxbValidationMessages.XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT,
-// this,
-// getXmlSchemaAnnotation().getElementFormDefaultTextRange(astRoot)));
-// }
-// }
- }
-
- protected boolean formConflicts(XmlNsForm form, XSDForm xsdForm) {
- return (form == XmlNsForm.QUALIFIED) ^ (xsdForm == XSDForm.QUALIFIED_LITERAL);
- }
-
-
- /**
- * xml ns prefix container adapter
- */
- protected class XmlNsPrefixContainer
- extends ContextListContainer<XmlNs, XmlNsAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XML_NS_PREFIXES_LIST;
- }
-
- @Override
- protected XmlNs buildContextElement(XmlNsAnnotation resourceElement) {
- return GenericJavaXmlSchema.this.buildXmlNs(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlNsAnnotation> getResourceElements() {
- return GenericJavaXmlSchema.this.getXmlNsAnnotations();
- }
-
- @Override
- protected XmlNsAnnotation getResourceElement(XmlNs contextElement) {
- return contextElement.getResourceXmlNs();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
deleted file mode 100644
index 1cb1d4e01d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class GenericJavaXmlSchemaType
- extends AbstractJavaContextNode
- implements XmlSchemaType {
-
- protected final XmlSchemaTypeAnnotation annotation;
-
- protected JaxbQName qName;
-
- protected String type;
-
-
- protected GenericJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.qName = buildQName();
- this.type = this.getResourceTypeString();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlSchemaTypeQName(this);
- }
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- public XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- return this.annotation;
- }
-
- protected abstract JaxbPackage getJaxbPackage();
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- this.setType_(this.getResourceTypeString());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ********** type **********
-
- public String getType() {
- return this.type;
- }
-
- public void setType(String location) {
- this.annotation.setType(location);
- this.setType_(location);
- }
-
- protected void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- }
-
- protected String getResourceTypeString() {
- return this.annotation.getType();
- }
-
- public String getFullyQualifiedType() {
- return getXmlSchemaTypeAnnotation().getFullyQualifiedType();
- }
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition() {
- JaxbPackage pkg = getJaxbPackage();
- XsdSchema xsdSchema = (pkg == null) ? null : pkg.getXsdSchema();
- if (xsdSchema == null) {
- return null;
- }
-
- if (! StringTools.stringIsEmpty(this.qName.getName())) {
- return xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName());
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
-
- XsdTypeDefinition xsdType = getXsdTypeDefinition();
- if (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__NON_SIMPLE_TYPE,
- new String[] { qName.getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getXmlSchemaTypeAnnotation().getTypeTextRange(astRoot);
- }
-
-
- protected class XmlSchemaTypeQName
- extends AbstractJavaQName {
-
- protected XmlSchemaTypeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlSchemaType.this.getJaxbPackage();
- }
-
- @Override
- protected String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_TYPE_DESC;
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- return XmlSchemaType.DEFAULT_NAMESPACE;
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getSimpleTypeNameProposals(getNamespace(), filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String name = getName();
- String namespace = getNamespace();
-
- if (! StringTools.stringIsEmpty(name)) {
- XsdSchema schema = this.getXsdSchema();
-
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlSchemaType.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
deleted file mode 100644
index d4216aa54f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-public class GenericJavaXmlSeeAlso
- extends AbstractJavaContextNode
- implements XmlSeeAlso {
-
- protected final XmlSeeAlsoAnnotation annotation;
-
- protected final ListContainer<String, String> valueContainer;
-
-
- public GenericJavaXmlSeeAlso(JaxbTypeMapping parent, XmlSeeAlsoAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.valueContainer = this.buildValueContainer();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.valueContainer.synchronizeWithResourceModel();
- }
-
- public ListIterable<String> getClasses() {
- return this.valueContainer.getContextElements();
- }
-
- public int getClassesSize() {
- return this.valueContainer.getContextElementsSize();
- }
-
- public void addClass(int index, String clazz) {
- this.annotation.addClass(index, clazz);
- this.valueContainer.addContextElement(index, clazz);
- }
-
- public void removeClass(int index) {
- this.annotation.removeClass(index);
- this.valueContainer.removeContextElement(index);
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- this.annotation.moveClass(targetIndex, sourceIndex);
- this.valueContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.annotation.getFullyQualifiedClasses();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- protected ListContainer<String, String> buildValueContainer() {
- ValueContainer container = new ValueContainer();
- container.initialize();
- return container;
- }
-
-
- protected class ValueContainer
- extends ListContainer<String, String> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CLASSES_LIST;
- }
-
- @Override
- protected String buildContextElement(String resourceElement) {
- return resourceElement;
- }
-
- @Override
- protected ListIterable<String> getResourceElements() {
- return GenericJavaXmlSeeAlso.this.annotation.getClasses();
- }
-
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java
deleted file mode 100644
index ba23f4ee1c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-public class GenericJavaXmlTransientMapping
- extends AbstractJavaAttributeMapping<XmlTransientAnnotation> {
-
- public GenericJavaXmlTransientMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return EmptyIterable.instance();
- }
-
- @Override
- public boolean isTransient() {
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java
deleted file mode 100644
index be352f4c52..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlValueMapping
- extends AbstractJavaXmlNodeMapping<XmlValueAnnotation>
- implements XmlValueMapping {
-
- public GenericJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
-
- // ***** XmlList *****
-
- @Override
- protected boolean calculateDefaultXmlList() {
- return getPersistentAttribute().isJavaResourceAttributeCollectionType();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateSchemaType(messages, reporter, astRoot);
- }
-
- protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition xsdClassType = getClassMapping().getXsdTypeDefinition();
-
- if (xsdClassType == null) {
- return;
- }
-
- if (! xsdClassType.hasTextContent()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__NO_TEXT_CONTENT,
- this,
- getValidationTextRange(astRoot)));
- return;
- }
-
- XsdTypeDefinition xsdType = xsdClassType.getBaseType();
- XsdTypeDefinition expectedSchemaType = getDataTypeXsdTypeDefinition();
-
- if (xsdType == null || expectedSchemaType == null) {
- return;
- }
-
- if (! xsdType.typeIsValid(expectedSchemaType, isXmlList())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__INVALID_SCHEMA_TYPE,
- new String[] { getValueTypeName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java
deleted file mode 100644
index 8db3c4e7d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAnyAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAnyAttributeMappingDefinition INSTANCE =
- new JavaXmlAnyAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlAnyAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAnyAttributeMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java
deleted file mode 100644
index 9fdb50c8ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAnyElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlAnyElementMappingDefinition INSTANCE =
- new JavaXmlAnyElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_ELEMENT_REF,
- JAXB.XML_ELEMENT_REFS,
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED };
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlAnyElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAnyElementMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
deleted file mode 100644
index 76e21bfe76..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAttributeMappingDefinition INSTANCE =
- new JavaXmlAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_ATTACHMENT_REF,
- JAXB.XML_ID,
- JAXB.XML_IDREF,
- JAXB.XML_INLINE_BINARY_DATA,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_LIST,
- JAXB.XML_MIME_TYPE,
- JAXB.XML_SCHEMA_TYPE };
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAttributeMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
deleted file mode 100644
index 747b2c8e13..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
- implements DefaultJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlElementMappingDefinition INSTANCE =
- new JavaXmlElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- JAXB.XML_ID,
- JAXB.XML_IDREF,
- JAXB.XML_LIST,
- JAXB.XML_SCHEMA_TYPE,
- JAXB.XML_ATTACHMENT_REF,
- JAXB.XML_MIME_TYPE,
- JAXB.XML_INLINE_BINARY_DATA,
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementMapping(parent);
- }
-
- /**
- * From the JAXB spec section 8.12.5.1 Default Mapping:
- * <p>
- * A single valued property or field must be mapped by with the following default mapping annotation:<ul>
- * <li> @XmlElement
- * </ul>
- * <p>
- * A property or field with a collection type must be mapped by with the following default mapping annotation:<ul>
- * <li> if the property or field is annotated with @XmlList, then the default mapping annotation is:<ul>
- * <li> @XmlElement
- * </ul>
- * <li> otherwise the default mapping annotation is:<ul>
- * <li> @XmlElements({ @XmlElement(nillable=true)})
- * (NB: this actually means the same as
- * @XmlElement(nillable=true)
- * )
- * </ul>
- */
- public boolean isDefault(JaxbPersistentAttribute persistentAttribute) {
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java
deleted file mode 100644
index bf39f5f8c6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementRefMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementRefMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementRefMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java
deleted file mode 100644
index 809bbe33ff..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementRefsMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefsMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementRefsMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementRefsMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java
deleted file mode 100644
index 54a86d7233..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementsMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE
- = new JavaXmlElementsMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementsMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_IDREF,
- JAXB.XML_JAVA_TYPE_ADAPTER });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementsMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java
deleted file mode 100644
index 47827efa68..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlTransientMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlTransientMappingDefinition INSTANCE =
- new JavaXmlTransientMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlTransientMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlTransientMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java
deleted file mode 100644
index a426ae477b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlValueMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlValueMappingDefinition INSTANCE =
- new JavaXmlValueMappingDefinition();
-
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- JAXB.XML_LIST,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_SCHEMA_TYPE };
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlValueMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlValueMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java
deleted file mode 100644
index 125950698e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-public class PropertyAccessor
- extends AbstractJavaContextNode
- implements Accessor {
-
-
- protected final JavaResourceMethod resourceGetter;
-
- protected final JavaResourceMethod resourceSetter;
-
- public PropertyAccessor(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- super(parent);
- this.resourceGetter = resourceGetter;
- this.resourceSetter = resourceSetter;
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.calculateResourceMethodToAnnotate();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return null in this case
- //rather than attempting to define the type from the setter's parameters
- return getterMethod == null ? null : AccessorTools.getBaseTypeName(getterMethod);
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return false in this case
- //rather than attempting to use the setter's parameters
- return getterMethod == null ? false : AccessorTools.isCollectionType(getterMethod);
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return false in this case
- //rather than attempting to use the setter's parameters
- return getterMethod == null ? false : getterMethod.typeIsSubTypeOf(typeName);
- }
-
- public JavaResourceMethod getResourceGetterMethod() {
- return this.resourceGetter;
- }
-
- public JavaResourceMethod getResourceSetterMethod() {
- return this.resourceSetter;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return false;
- }
-
- public boolean isFor(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- return (this.resourceGetter == getterMethod) && (this.resourceSetter == setterMethod);
- }
-
- //since this is based on a preference as well as annotation location
- //we will just calculate it instead of handling it in sync and storing it.
- protected JavaResourceMethod calculateResourceMethodToAnnotate() {
- if (getterIsAnnotated()) {
- if (setterIsAnnotated()) {
- //use preference for which one to set the primary annotation on.
- return getAnnotateGetterPreference() ? this.resourceGetter : this.resourceSetter;
- }
- return this.resourceGetter;
- }
- else if (setterIsAnnotated()) {
- return this.resourceSetter;
- }
- else if (getAnnotateGetterPreference()&& this.resourceGetter != null) {
- return this.resourceGetter;
- }
- return this.resourceSetter;
- }
-
- protected boolean getterIsAnnotated() {
- return this.resourceGetter == null ? false : this.resourceGetter.isAnnotated();
- }
-
- protected boolean setterIsAnnotated() {
- return this.resourceSetter == null ? false : this.resourceSetter.isAnnotated();
- }
-
- //TODO bug 333483 - make this a preference for the user to select whether the getter or setter should be annotated.
- protected boolean getAnnotateGetterPreference() {
- return true;
- }
-
- //TODO validation - bug 333484
- //if (getterIsAnnotated() && setterIsAnnotated()) error to user
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java
deleted file mode 100644
index a9d2a5f736..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-
-public interface JaxbFacetDataModelProperties
- extends IDataModelProperties {
-
- static final String PREFIX_
- = JaxbFacetDataModelProperties.class.getSimpleName() + "."; //$NON-NLS-1$
-
- public static final String PLATFORM
- = PREFIX_ + "PLATFORM"; //$NON-NLS-1$
-
- public static final String LIBRARY_INSTALL_DELEGATE
- = PREFIX_ + "LIBRARY_INSTALL_DELEGATE"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
deleted file mode 100644
index 638e6ea8c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-
-
-public abstract class JaxbFacetDataModelProvider
- extends FacetInstallDataModelProvider
- implements JaxbFacetDataModelProperties {
-
- protected static final DataModelPropertyDescriptor[] EMPTY_DMPD_ARRAY = new DataModelPropertyDescriptor[0];
-
-
- protected static final Comparator<DataModelPropertyDescriptor> DMPD_COMPARATOR =
- new Comparator<DataModelPropertyDescriptor>() {
- public int compare(DataModelPropertyDescriptor dmpd1, DataModelPropertyDescriptor dmpd2) {
- return dmpd1.getPropertyDescription().compareTo(dmpd2.getPropertyDescription());
- }
- };
-
-
-
- // listens to primary runtime changing
- private IFacetedProjectListener fprojListener;
-
- private LibraryInstallDelegate defaultLibraryInstallDelegate;
-
-
- protected JaxbFacetDataModelProvider() {
- super();
- this.fprojListener = buildFprojListener();
- }
-
-
- protected IFacetedProjectListener buildFprojListener() {
- return new IFacetedProjectListener() {
- public void handleEvent(IFacetedProjectEvent event) {
- getLibraryInstallDelegate().refresh();
- }
- };
- }
-
- @Override
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(PLATFORM);
- names.add(LIBRARY_INSTALL_DELEGATE);
- return names;
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID)) {
- return JaxbFacet.ID;
- }
- else if (propertyName.equals(PLATFORM)) {
- return getDefaultPlatform();
- }
- else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) {
- return getDefaultLibraryInstallDelegate();
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
- protected JaxbPlatformDescription getDefaultPlatform() {
- return JptJaxbCorePlugin.getDefaultPlatform(getProjectFacetVersion());
- }
-
- protected LibraryInstallDelegate getDefaultLibraryInstallDelegate() {
- // delegate itself changes only when facet version changes
- if (this.defaultLibraryInstallDelegate == null) {
- this.defaultLibraryInstallDelegate = buildDefaultLibraryInstallDelegate();
- }
- else if (! this.defaultLibraryInstallDelegate.getProjectFacetVersion().equals(getProjectFacetVersion())) {
- this.defaultLibraryInstallDelegate.dispose();
- this.defaultLibraryInstallDelegate = buildDefaultLibraryInstallDelegate();
- }
- return defaultLibraryInstallDelegate;
- }
-
- protected LibraryInstallDelegate buildDefaultLibraryInstallDelegate() {
- IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
- IProjectFacetVersion pfv = getProjectFacetVersion();
- if (fpjwc == null || pfv == null) {
- return null;
- }
- LibraryInstallDelegate lid = new LibraryInstallDelegate(fpjwc, pfv);
- lid.addListener(buildLibraryInstallDelegateListener());
- return lid;
- }
-
- protected IPropertyChangeListener buildLibraryInstallDelegateListener() {
- return new IPropertyChangeListener() {
- public void propertyChanged(String property, Object oldValue, Object newValue ) {
- if (LibraryInstallDelegate.PROP_AVAILABLE_PROVIDERS.equals(property)) {
- adjustLibraryInstallDelegate();
- }
- getDataModel().notifyPropertyChange(LIBRARY_INSTALL_DELEGATE, IDataModel.VALUE_CHG);
- }
- };
- }
-
- protected void adjustLibraryInstallDelegate() {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
- if (lid != null) {
- List<JaxbLibraryProviderInstallOperationConfig> jaxbConfigs
- = new ArrayList<JaxbLibraryProviderInstallOperationConfig>();
- // add the currently selected one first
- JaxbLibraryProviderInstallOperationConfig currentJaxbConfig = null;
- LibraryProviderOperationConfig config = lid.getLibraryProviderOperationConfig();
- if (config instanceof JaxbLibraryProviderInstallOperationConfig) {
- currentJaxbConfig = (JaxbLibraryProviderInstallOperationConfig) config;
- jaxbConfigs.add(currentJaxbConfig);
- }
- for (ILibraryProvider lp : lid.getLibraryProviders()) {
- config = lid.getLibraryProviderOperationConfig(lp);
- if (config instanceof JaxbLibraryProviderInstallOperationConfig
- && ! config.equals(currentJaxbConfig)) {
- jaxbConfigs.add((JaxbLibraryProviderInstallOperationConfig) config);
- }
- }
- for (JaxbLibraryProviderInstallOperationConfig jaxbConfig : jaxbConfigs) {
- jaxbConfig.setJaxbPlatform(getPlatform());
- }
- }
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACETED_PROJECT_WORKING_COPY)) {
- // should only be done once
- IFacetedProjectWorkingCopy fproj = (IFacetedProjectWorkingCopy) propertyValue;
- fproj.addListener(this.fprojListener, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
- }
- else if (propertyName.equals(FACET_VERSION)) {
- adjustLibraryInstallDelegate();
- this.model.notifyPropertyChange(PLATFORM, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(LIBRARY_INSTALL_DELEGATE, IDataModel.DEFAULT_CHG);
- }
- else if (propertyName.equals(PLATFORM)) {
- adjustLibraryInstallDelegate();
- }
-
- return ok;
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return this.buildValidPlatformDescriptors();
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- protected DataModelPropertyDescriptor[] buildValidPlatformDescriptors() {
- Iterable<JaxbPlatformDescription> validPlatformDescriptions = buildValidPlatformDescriptions();
- Iterable<DataModelPropertyDescriptor> validPlatformDescriptors =
- new TransformationIterable<JaxbPlatformDescription, DataModelPropertyDescriptor>(validPlatformDescriptions) {
- @Override
- protected DataModelPropertyDescriptor transform(JaxbPlatformDescription description) {
- return buildPlatformDescriptor(description);
- }
- };
- return ArrayTools.sort(ArrayTools.array(validPlatformDescriptors, EMPTY_DMPD_ARRAY), DMPD_COMPARATOR);
- }
-
- protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() {
- return new FilteringIterable<JaxbPlatformDescription>(
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatforms()) {
- @Override
- protected boolean accept(JaxbPlatformDescription o) {
- return o.supportsJaxbFacetVersion(getProjectFacetVersion());
- }
- };
- }
-
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return buildPlatformDescriptor(getPlatform());
- }
-
- return super.getPropertyDescriptor(propertyName);
- }
-
- protected DataModelPropertyDescriptor buildPlatformDescriptor(JaxbPlatformDescription desc) {
- return new DataModelPropertyDescriptor(desc, desc.getLabel());
- }
-
- // ********** validation **********
-
- protected static IStatus OK_STATUS = Status.OK_STATUS;
-
- protected static IStatus buildErrorStatus(String message) {
- return buildStatus(IStatus.ERROR, message);
- }
-
- protected static IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- @Override
- public IStatus validate(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return this.validatePlatform();
- }
- else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) {
- return getLibraryInstallDelegate().validate();
- }
-
- return super.validate(propertyName);
- }
-
- protected IStatus validatePlatform() {
- return (getPlatform() == null) ?
- buildErrorStatus(JptJaxbCoreMessages.JaxbFacetConfig_validatePlatformNotSpecified)
- : OK_STATUS;
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return (IFacetedProjectWorkingCopy) getProperty(FACETED_PROJECT_WORKING_COPY);
- }
-
- protected IProjectFacetVersion getProjectFacetVersion() {
- return (IProjectFacetVersion) getProperty(FACET_VERSION);
- }
-
- protected JaxbPlatformDescription getPlatform() {
- return (JaxbPlatformDescription) getProperty(PLATFORM);
- }
-
- protected LibraryInstallDelegate getLibraryInstallDelegate() {
- return (LibraryInstallDelegate) getProperty(LIBRARY_INSTALL_DELEGATE);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- getFacetedProjectWorkingCopy().removeListener(this.fprojListener);
- this.defaultLibraryInstallDelegate.dispose();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java
deleted file mode 100644
index 2a5a516cb1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public abstract class JaxbFacetDelegate
- implements IDelegate {
-
- public final void execute(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- this.execute_(project, fv, config, monitor);
- }
-
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- SubMonitor subMonitor = SubMonitor.convert(monitor, 7);
-
- IDataModel jaxbConfig = (IDataModel) config;
-
- // project settings
- JaxbPlatformDescription platform =
- (JaxbPlatformDescription) jaxbConfig.getProperty(JaxbFacetDataModelProperties.PLATFORM);
- JptJaxbCorePlugin.setJaxbPlatform(project, platform);
- subMonitor.worked(1);
-
- // defaults settings
- JptJaxbCorePlugin.setDefaultJaxbPlatform(fv, platform);
- subMonitor.worked(1);
-
- //Delegate to LibraryInstallDelegate to configure the project classpath
- LibraryInstallDelegate lid =
- (LibraryInstallDelegate) jaxbConfig.getProperty(JaxbFacetDataModelProperties.LIBRARY_INSTALL_DELEGATE);
- lid.execute(subMonitor.newChild(1));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java
deleted file mode 100644
index a1c426ccf2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public interface JaxbFacetInstallDataModelProperties
- extends JaxbFacetDataModelProperties {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
deleted file mode 100644
index cf5d982cf8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public class JaxbFacetInstallDataModelProvider
- extends JaxbFacetDataModelProvider
- implements JaxbFacetInstallDataModelProperties {
-
- public JaxbFacetInstallDataModelProvider() {
- super();
- }
-
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACET_VERSION)) {
- if (! getPlatform().supportsJaxbFacetVersion(getProjectFacetVersion())) {
- getDataModel().setProperty(PLATFORM, null);
- }
- }
-
- return ok;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java
deleted file mode 100644
index 7724832546..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.validation.ValidationFramework;
-
-
-public class JaxbFacetInstallDelegate
- extends JaxbFacetDelegate {
-
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- ValidationFramework.getDefault().addValidationBuilder(project);
- super.execute_(project, fv, config, monitor);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java
deleted file mode 100644
index 53e1d9a43c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbFacetUninstallDelegate
- implements IDelegate {
-
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java
deleted file mode 100644
index d9c5b2a932..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public interface JaxbFacetVersionChangeDataModelProperties
- extends JaxbFacetDataModelProperties {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java
deleted file mode 100644
index d5772b50e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class JaxbFacetVersionChangeDataModelProvider
- extends JaxbFacetDataModelProvider
- implements JaxbFacetVersionChangeDataModelProperties {
-
- public JaxbFacetVersionChangeDataModelProvider() {
- super();
- }
-
-
- @Override
- protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() {
- // add existing platform to list of choices
- Iterable<JaxbPlatformDescription> validPlatformDescs = super.buildValidPlatformDescriptions();
- if (! CollectionTools.contains(validPlatformDescs, getPlatform())) {
- validPlatformDescs = new CompositeIterable(getPlatform(), validPlatformDescs);
- }
- return validPlatformDescs;
- }
-
- @Override
- protected IStatus validatePlatform() {
- IStatus status = super.validatePlatform();
-
- if (status.isOK()) {
- if (! getPlatform().supportsJaxbFacetVersion(getProjectFacetVersion())) {
- status = buildErrorStatus(JptJaxbCoreMessages.JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion);
- }
- }
-
- return status;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
deleted file mode 100644
index 2c7a4bc95f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbFacetVersionChangeDelegate
- extends JaxbFacetDelegate {
-
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv, Object config,
- IProgressMonitor monitor) throws CoreException {
-
- SubMonitor sm = SubMonitor.convert(monitor, 2);
- super.execute_(project, fv, config, sm.newChild(1));
-
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(project);
- sm.worked(1);
- // nothing further to do here *just* yet
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
deleted file mode 100644
index 5562320863..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * ClassesGenerator
- */
-public class ClassesGenerator extends AbstractJptGenerator
-{
- public static final String LAUNCH_CONFIG_NAME = "JAXB Run Config"; //$NON-NLS-1$
- public static final String JAXB_GENERIC_GEN_CLASS = "com.sun.tools.xjc.XJCFacade"; //$NON-NLS-1$
- public static final String JAXB_GENERIC_GEN_JDK_CLASS = "com.sun.tools.internal.xjc.XJCFacade"; //$NON-NLS-1$
- public static final String JAXB_ECLIPSELINK_GEN_CLASS = "org.eclipse.persistence.jaxb.xjc.MOXyXJC"; //$NON-NLS-1$
-
- private final String schemaPathOrUri;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final String[] bindingsFileNames;
- private final ClassesGeneratorOptions generatorOptions;
- private final ClassesGeneratorExtensionOptions generatorExtensionOptions;
- private final String mainType;
- private String toolsJarPath;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new ClassesGenerator(javaProject,
- schemaPathOrUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions).generate(monitor);
- }
-
- /**
- * Test if the JDK Jaxb compiler is on the classpath.
- */
- public static boolean genericJaxbJdkIsOnClasspath(IJavaProject javaProject) {
- try {
- IType genClass = javaProject.findType(JAXB_GENERIC_GEN_JDK_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the non-JDK Jaxb compiler is on the classpath.
- */
- public static boolean genericJaxbNonJdkIsOnClasspath(IJavaProject javaProject) {
- try {
- IType genClass = javaProject.findType(JAXB_GENERIC_GEN_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static IVMInstall getVMInstall(IJavaProject javaProject) throws CoreException {
- return JavaRuntime.getVMInstall(javaProject);
- }
-
- public static String getVMInstallLocation(IVMInstall vm) {
- return vm.getInstallLocation().getAbsolutePath();
- }
-
- public static String getVMInstallToolsJarAbsolutePath(IVMInstall vm) {
- String vmInstallLocation = getVMInstallLocation(vm);
- return vmInstallLocation + File.separator + "lib" + File.separator + "tools.jar"; //$NON-NLS-1$
- }
-
- public static String buildToolsJarPath(IJavaProject javaProject) {
- try {
- IVMInstall vm = getVMInstall(javaProject);
- return getVMInstallToolsJarAbsolutePath(vm);
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static String findToolsJarPath(IJavaProject javaProject) {
- String toolsAbsolutePath = buildToolsJarPath(javaProject);
- return ((new File(toolsAbsolutePath)).exists()) ? toolsAbsolutePath : null;
- }
-
- public static boolean toolsJarExists(IJavaProject javaProject) {
- return (findToolsJarPath(javaProject) != null);
- }
-
- // ********** constructors **********
-
- protected ClassesGenerator(
- IJavaProject javaProject,
- String schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
- super(javaProject);
- this.schemaPathOrUri = schemaPathOrUri;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.bindingsFileNames = bindingsFileNames;
- this.generatorOptions = generatorOptions;
- this.generatorExtensionOptions = generatorExtensionOptions;
-
- this.mainType = this.buildMainType(javaProject, usesMoxyGenerator);
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected void specifyJRE() {
- // do nothing
- }
-
- // ********** behavior **********
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // nothing to do yet...
- }
-
- // ********** private methods **********
-
- protected String buildMainType(IJavaProject javaProject, boolean usesMoxyGenerator) {
- if(usesMoxyGenerator) {
- return JAXB_ECLIPSELINK_GEN_CLASS;
- }
- else if(genericJaxbNonJdkIsOnClasspath(javaProject)) {
- return JAXB_GENERIC_GEN_CLASS;
- }
- else if(genericJaxbJdkIsOnClasspath(javaProject)) {
- return JAXB_GENERIC_GEN_JDK_CLASS;
- }
- this.toolsJarPath = findToolsJarPath(javaProject);
- return JAXB_GENERIC_GEN_JDK_CLASS;
- }
-
- private IRuntimeClasspathEntry getToolsClasspathEntry() {
- return (StringTools.stringIsEmpty(this.toolsJarPath)) ?
- null :
- getArchiveClasspathEntry(new Path(this.toolsJarPath));
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- // Containers classpath
- for(IRuntimeClasspathEntry containerClasspathEntry: this.getContainersClasspathEntries()) {
- classpath.add(containerClasspathEntry.getMemento());
- }
- // Tools classpath
- IRuntimeClasspathEntry toolsClasspathEntry = this.getToolsClasspathEntry();
- if(toolsClasspathEntry != null) {
- classpath.add(toolsClasspathEntry.getMemento());
- }
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
- StringBuffer programArguments = new StringBuffer();
-
- programArguments.append("-d "); //$NON-NLS-1$
- if(StringTools.stringIsEmpty(this.outputDir)) {
- throw new RuntimeException("Output directory cannot be empty"); //$NON-NLS-1$
- }
- programArguments.append(StringTools.quote(this.outputDir));
- if( ! StringTools.stringIsEmpty(this.targetPackage)) {
- programArguments.append(" -p "); //$NON-NLS-1$
- programArguments.append(this.targetPackage);
- }
- if( ! StringTools.stringIsEmpty(this.catalog)) {
- programArguments.append(" -catalog "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.catalog));
- }
-
- // Options
- if( ! StringTools.stringIsEmpty(this.generatorOptions.getProxy())) {
- programArguments.append(" -httpproxy "); //$NON-NLS-1$
- programArguments.append(this.generatorOptions.getProxy());
- }
- if( ! StringTools.stringIsEmpty(this.generatorOptions.getProxyFile())) {
- programArguments.append(" -httpproxyfile "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.generatorOptions.getProxyFile()));
- }
-
- if( ! this.generatorOptions.usesStrictValidation()) {
- programArguments.append(" -nv"); //$NON-NLS-1$
- }
- if(this.generatorOptions.makesReadOnly()) {
- programArguments.append(" -readOnly"); //$NON-NLS-1$
- }
- if(this.generatorOptions.suppressesPackageInfoGen()) {
- programArguments.append(" -npa"); //$NON-NLS-1$
- }
- if(this.generatorOptions.suppressesHeaderGen()) {
- programArguments.append(" -no-header"); //$NON-NLS-1$
- }
- if(this.generatorOptions.isVerbose()) {
- programArguments.append(" -verbose"); //$NON-NLS-1$
- }
- if(this.generatorOptions.isQuiet()) {
- programArguments.append(" -quiet"); //$NON-NLS-1$
- }
-
- if(this.generatorOptions.treatsAsXmlSchema()) {
- programArguments.append(" -xmlschema"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsRelaxNg()) {
- programArguments.append(" -relaxng"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsRelaxNgCompact()) {
- programArguments.append(" -relaxng-compact"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsDtd()) {
- programArguments.append(" -dtd"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsWsdl()) {
- programArguments.append(" -wsdl"); //$NON-NLS-1$
- }
- if(this.generatorOptions.showsVersion()) {
- programArguments.append(" -version"); //$NON-NLS-1$
- }
- if(this.generatorOptions.showsHelp()) {
- programArguments.append(" -help"); //$NON-NLS-1$
- }
-
- // Extension Options
- if(this.generatorExtensionOptions.allowsExtensions()) {
- programArguments.append(" -extension"); //$NON-NLS-1$
- }
- if( ! StringTools.stringIsEmpty(this.generatorExtensionOptions.getClasspath())) {
- programArguments.append(" -classpath "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.generatorExtensionOptions.getClasspath()));
- }
- if( ! StringTools.stringIsEmpty(this.generatorExtensionOptions.getAdditionalArgs())) {
- programArguments.append(' ');
- programArguments.append(this.generatorExtensionOptions.getAdditionalArgs());
- }
-
- // schema
- programArguments.append(' ');
- if(StringTools.stringIsEmpty(this.schemaPathOrUri)) {
- throw new RuntimeException("Schema cannot be empty"); //$NON-NLS-1$
- }
- programArguments.append(StringTools.quote(this.schemaPathOrUri));
-
- // bindings
- if (this.bindingsFileNames.length > 0) {
- for (String bindingsFileName : this.bindingsFileNames) {
- programArguments.append(" -b "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(bindingsFileName));
- }
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
-
- // ********** Queries **********
-
- private List<IRuntimeClasspathEntry> getContainersClasspathEntries() throws CoreException {
- ArrayList<IRuntimeClasspathEntry> classpathEntries = new ArrayList<IRuntimeClasspathEntry>();
- for(IClasspathEntry classpathEntry: this.javaProject.getRawClasspath()) {
- if(classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), this.javaProject);
- if(container != null && container.getKind() == IClasspathContainer.K_SYSTEM) {
- classpathEntries.add(
- JavaRuntime.newRuntimeContainerClasspathEntry(
- container.getPath(),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES,
- this.javaProject));
- }
- }
- }
- return classpathEntries;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java
deleted file mode 100644
index 476945fbe6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-/**
- * ClassesGeneratorExtensionOptions
- */
-public class ClassesGeneratorExtensionOptions
-{
- private String classpath;
- private boolean allowsExtensions;
-
- private String additionalArgs;
-
- // ********** constructor **********
-
- public ClassesGeneratorExtensionOptions() {
- super();
- }
-
- // ********** getters/setters *********
-
- public boolean allowsExtensions() {
- return this.allowsExtensions;
- }
-
- public void setAllowsExtensions(boolean allowsExtensions) {
- this.allowsExtensions = allowsExtensions;
- }
-
- public String getClasspath() {
- return this.classpath;
- }
-
- public void setClasspath(String classpath){
- this.classpath = classpath;
- }
-
- public String getAdditionalArgs() {
- return this.additionalArgs;
- }
-
- public void setAdditionalArgs(String additionalArgs){
- this.additionalArgs = additionalArgs;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java
deleted file mode 100644
index 1a2cf799d5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-
-/**
- * ClassesGeneratorOptions
- */
-public class ClassesGeneratorOptions
-{
- private String proxy;
- private String proxyFile;
-
- private boolean usesStrictValidation;
- private boolean makesReadOnly;
- private boolean suppressesPackageInfoGen;
- private boolean suppressesHeaderGen;
- private boolean isVerbose;
- private boolean isQuiet;
-
- private boolean treatsAsXmlSchema;
- private boolean treatsAsRelaxNg;
- private boolean treatsAsRelaxNgCompact;
- private boolean treatsAsDtd;
- private boolean treatsAsWsdl;
- private boolean showsVersion;
- private boolean showsHelp;
-
- // ********** constructor **********
-
- public ClassesGeneratorOptions() {
- super();
- }
-
- // ********** getters/setters *********
-
- public String getProxy() {
- return this.proxy;
- }
-
- public void setProxy(String proxy){
- this.proxy = proxy;
- }
-
- public String getProxyFile() {
- return this.proxyFile;
- }
-
- public void setProxyFile(String proxyFile){
- this.proxyFile = proxyFile;
- }
-
- public boolean suppressesPackageInfoGen() {
- return this.suppressesPackageInfoGen;
- }
-
- public void setSuppressesPackageInfoGen(boolean suppressesPackageInfoGen) {
- this.suppressesPackageInfoGen = suppressesPackageInfoGen;
- }
-
- public boolean usesStrictValidation() {
- return this.usesStrictValidation;
- }
-
- public void setUsesStrictValidation(boolean usesStrictValidation) {
- this.usesStrictValidation = usesStrictValidation;
- }
-
- public boolean makesReadOnly() {
- return this.makesReadOnly;
- }
-
- public void setMakesReadOnly(boolean makesReadOnly) {
- this.makesReadOnly = makesReadOnly;
- }
-
- public boolean suppressesHeaderGen() {
- return this.suppressesHeaderGen;
- }
-
- public void setSuppressesHeaderGen(boolean suppressesHeaderGen){
- this.suppressesHeaderGen = suppressesHeaderGen;
- }
-
- public boolean isVerbose() {
- return this.isVerbose;
- }
-
- public void setIsVerbose(boolean isVerbose){
- this.isVerbose = isVerbose;
- }
-
- public boolean isQuiet() {
- return this.isQuiet;
- }
-
- public void setIsQuiet(boolean isQuiet){
- this.isQuiet = isQuiet;
- }
-
- public boolean treatsAsXmlSchema() {
- return this.treatsAsXmlSchema;
- }
-
- public void setTreatsAsXmlSchema(boolean treatsAsXmlSchema){
- this.treatsAsXmlSchema = treatsAsXmlSchema;
- }
-
- public boolean treatsAsRelaxNg() {
- return this.treatsAsRelaxNg;
- }
-
- public void setTreatsAsRelaxNg(boolean treatsAsRelaxNg){
- this.treatsAsRelaxNg = treatsAsRelaxNg;
- }
-
- public boolean treatsAsRelaxNgCompact() {
- return this.treatsAsRelaxNgCompact;
- }
-
- public void setTreatsAsRelaxNgCompact(boolean treatsAsRelaxNgCompact){
- this.treatsAsRelaxNgCompact = treatsAsRelaxNgCompact;
- }
-
- public boolean treatsAsDtd() {
- return this.treatsAsDtd;
- }
-
- public void setTreatsAsDtd(boolean treatsAsDtd){
- this.treatsAsDtd = treatsAsDtd;
- }
-
- public boolean treatsAsWsdl() {
- return this.treatsAsWsdl;
- }
-
- public void setTreatsAsWsdl(boolean treatsAsWsdl){
- this.treatsAsWsdl = treatsAsWsdl;
- }
-
- public boolean showsVersion() {
- return this.showsVersion;
- }
-
- public void setShowsVersion(boolean showsVersion){
- this.showsVersion = showsVersion;
- }
-
- public boolean showsHelp() {
- return this.showsHelp;
- }
-
- public void setShowsHelp(boolean showsHelp){
- this.showsHelp = showsHelp;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java
deleted file mode 100644
index 0db2a9e337..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-
-/**
- * GenerateJaxbClassesJob
- */
-public class GenerateJaxbClassesJob extends WorkspaceJob {
- private final IJavaProject javaProject;
- private final String absoluteLocalXsdUri;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final boolean usesMoxyGenerator;
- private final String[] bindingsFileNames;
- private final ClassesGeneratorOptions generatorOptions;
- private final ClassesGeneratorExtensionOptions generatorExtensionOptions;
-
- // ********** constructors **********
-
- public GenerateJaxbClassesJob(
- IJavaProject javaProject,
- String absoluteLocalXsdUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
-
- super(JptJaxbCoreMessages.ClassesGenerator_generatingClasses);
- if (javaProject == null) {
- throw new RuntimeException("Project is null"); //$NON-NLS-1$
- }
- else if (StringTools.stringIsEmpty(absoluteLocalXsdUri)) {
- throw new RuntimeException("Schema cannot be empty"); //$NON-NLS-1$
- }
- else if(StringTools.stringIsEmpty(outputDir)) {
- throw new RuntimeException("Output directory cannot be empty"); //$NON-NLS-1$
- }
- this.javaProject = javaProject;
- this.absoluteLocalXsdUri = absoluteLocalXsdUri;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.usesMoxyGenerator = usesMoxyGenerator;
- this.bindingsFileNames = bindingsFileNames;
- this.generatorOptions = generatorOptions;
- this.generatorExtensionOptions = generatorExtensionOptions;
- this.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(this.javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, JptJaxbCoreMessages.ClassesGenerator_generatingClassesTask, 1);
- try {
- this.classesGeneratorGenerate(this.javaProject,
- this.absoluteLocalXsdUri,
- this.outputDir,
- this.targetPackage,
- this.catalog,
- this.usesMoxyGenerator,
- this.bindingsFileNames,
- this.generatorOptions,
- this.generatorExtensionOptions,
- sm.newChild(1));
- }
- catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- // fall through and tell monitor we are done
- }
- catch (RuntimeException re) {
- throw new RuntimeException(re);
- }
- return Status.OK_STATUS;
-}
-
- private void classesGeneratorGenerate(IJavaProject javaProject,
- String absoluteLocalXsdUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- ClassesGenerator.generate(javaProject,
- absoluteLocalXsdUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions,
- monitor);
- return;
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
deleted file mode 100644
index 2d821a9114..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-
-/**
- * SchemaGenerator
- */
-public class SchemaGenerator extends AbstractJptGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "JAXB Schema Gen Run Config"; //$NON-NLS-1$
- static public String JAXB_SCHEMA_GEN_PACKAGE_NAME = "org.eclipse.jpt.jaxb.core.schemagen"; //$NON-NLS-1$
- static public String JAXB_SCHEMA_GEN_CLASS = JAXB_SCHEMA_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME = "org.eclipse.jpt.jaxb.eclipselink.core.schemagen"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_CLASS = ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
-
- static public String ECLIPSELINK_JAXB_CONTEXT_FACTORY = "org.eclipse.persistence.jaxb.JAXBContextFactory"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS = "javax.xml.bind.context.factory=" + ECLIPSELINK_JAXB_CONTEXT_FACTORY; //$NON-NLS-1$
- static public String JAXB_PROPERTIES_FILE_NAME = "jaxb.properties"; //$NON-NLS-1$
-
- static public String JAXB_SCHEMA_GEN_JAR_PREFIX = JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_JAR_PREFIX = ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
-
- static public String JAXB_GENERIC_SCHEMA_GEN_CLASS = "javax.xml.bind.JAXBContext"; //$NON-NLS-1$
- static public String JAXB_ECLIPSELINK_SCHEMA_GEN_CLASS = "org.eclipse.persistence.jaxb.JAXBContext"; //$NON-NLS-1$
-
- private final String targetSchemaName;
- private final String[] sourceClassNames;
- private String mainType;
- private boolean useMoxy;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy,
- IProgressMonitor monitor) {
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new SchemaGenerator(javaProject,
- targetSchemaName,
- sourceClassNames,
- useMoxy).generate(monitor);
- }
-
- // ********** constructors **********
-
- protected SchemaGenerator(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy) {
- super(javaProject);
- this.targetSchemaName = targetSchemaName;
- this.sourceClassNames = sourceClassNames;
- this.useMoxy = useMoxy;
- this.mainType = (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_CLASS :
- JAXB_SCHEMA_GEN_CLASS;
- this.initialize();
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_JAR_PREFIX :
- JAXB_SCHEMA_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // generate jaxb.properties file if necessary
- if(this.useMoxy) {
- if( ! this.jaxbPropertiesFileIsPresent()) {
- this.generateJaxbPropertiesFile(monitor);
- }
- else if( ! this.jaxbContextUsesMoxy()) {
- //properties file actually specifies a different implementation
- //override wizard setting and fall back to generic generation
- this.useMoxy = false;
- this.mainType = JAXB_SCHEMA_GEN_CLASS;
- }
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Schema_Gen jar
- classpath.add(this.getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
-
- StringBuffer programArguments = new StringBuffer();
- // sourceClassNames
- this.appendClassNameArguments(programArguments);
-
- // schema
- programArguments.append(" -s \""); //$NON-NLS-1$
- programArguments.append(this.targetSchemaName);
- programArguments.append('"');
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** private methods **********
-
- private void appendClassNameArguments(StringBuffer sb) {
- for (String className : this.sourceClassNames) {
- sb.append(" -c "); //$NON-NLS-1$
- sb.append(className);
- }
- }
-
- /**
- * Returns the first "jaxb.properties" file that is found in a valid source
- * folder in the project.
- *
- * Returns null if no "jaxb.properties" file is found.
- */
- private IFile getJaxbPropertiesFile() {
- return getJaxbPropertiesFileFromPackageRoots(JDTTools.getJavaSourceFolders(this.javaProject));
- }
-
- private IFile getJaxbPropertiesFileFromPackageRoots(Iterable<IPackageFragmentRoot> packageFragmentRoots){
- IJavaElement[] javaElements;
- IFile jaxbPropertiesFile = null;
- try {
- for (IPackageFragmentRoot pfr : packageFragmentRoots) {
- jaxbPropertiesFile = this.findJaxbPropertiesFile(pfr.getNonJavaResources());
- if(jaxbPropertiesFile != null) {
- return jaxbPropertiesFile;
- }
- javaElements = pfr.getChildren();
- for(IJavaElement je : javaElements) {
- jaxbPropertiesFile = this.findJaxbPropertiesFile(((IPackageFragment)je).getNonJavaResources());
- if(jaxbPropertiesFile != null) {
- return jaxbPropertiesFile;
- }
- }
- }
- } catch (JavaModelException jme) {
- throw new RuntimeException(jme);
- }
- return null;
- }
-
- private IFile findJaxbPropertiesFile(Object[] objects) throws JavaModelException {
- for(Object object : objects) {
- IResource resource = (IResource) object;
- if(resource.getName().equals(JAXB_PROPERTIES_FILE_NAME)) {
- // jaxb.properties has been found
- return (IFile)resource;
- }
- }
- return null;
- }
-
- private boolean jaxbPropertiesFileIsPresent() {
- return this.getJaxbPropertiesFile() != null;
- }
-
- private boolean jaxbContextUsesMoxy() {
-
- InputStream in = null;
- try {
- in = this.getJaxbPropertiesFile().getContents();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- String line = reader.readLine();
- //jaxb.properties will only contain one property entry, the JAXBContextFactory
- String propertyValue = line.substring(line.indexOf("=") + 1); //$NON-NLS-1$
- if (propertyValue.equals(ECLIPSELINK_JAXB_CONTEXT_FACTORY)) {
- return true;
- }
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- }
- }
- }
- return false;
- }
-
- private void generateJaxbPropertiesFile(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 1);
- sm.subTask(JptJaxbCoreMessages.SchemaGenerator_creatingJAXBPropertiesFileTask);
-
- IPackageFragment packageFragment = this.findPackageFragementForSourceClassName(this.sourceClassNames[0]);
-
- IFolder folder = (IFolder)packageFragment.getResource();
- IFile file = folder.getFile(JAXB_PROPERTIES_FILE_NAME);
-
- byte[] bytes;
- try {
- bytes = ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS.getBytes("UTF-8"); //$NON-NLS-1$
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
-
- InputStream contents = new ByteArrayInputStream(bytes);
-
- try {
- //the input stream will be closed as a result of calling create
- file.create(contents, IResource.NONE, sm.newChild(1));
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
- }
-
- private IPackageFragment findPackageFragementForSourceClassName(String sourceClassName) {
-
- if(this.classIsInDefaultPackage(sourceClassName)) {
- return this.emptyPackageFragment();
- }
- String packageName = sourceClassName.substring(0, sourceClassName.lastIndexOf('.'));
-
- //Find the existing package fragment where we want to generate
- for (IPackageFragmentRoot pfr : JDTTools.getJavaSourceFolders(this.javaProject)) {
- //use the package of the first source class as the package for generation
- IPackageFragment packageFragment = pfr.getPackageFragment(packageName);
- if (packageFragment.exists()){
- return packageFragment;
- }
- }
- //the existing package fragment was not found
- throw new IllegalStateException("Java package must exist for source class"); //$NON-NLS-1$
- }
-
- private IPackageFragment emptyPackageFragment() {
- return this.getFirstJavaSourceFolder().getPackageFragment(""); //$NON-NLS-1$
- }
-
- private IPackageFragmentRoot getFirstJavaSourceFolder() {
- Iterator<IPackageFragmentRoot> i = JDTTools.getJavaSourceFolders(this.javaProject).iterator();
- return i.hasNext() ? i.next() : null;
- }
-
- private boolean classIsInDefaultPackage(String sourceClassName) {
- return ! sourceClassName.contains("."); //$NON-NLS-1$
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java
deleted file mode 100644
index b7594bd39c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbFactory;
-
-/**
- * Generic JAXB version 2.1
- */
-public class GenericJaxb_2_1_Factory
- extends AbstractJaxbFactory {
-
- // singleton
- private static final JaxbFactory INSTANCE = new GenericJaxb_2_1_Factory();
-
- /**
- * Return the singleton.
- */
- public static JaxbFactory instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GenericJaxb_2_1_Factory() {
- super();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
deleted file mode 100644
index 72b0f4ab33..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.internal.JavaPackageInfoResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyElementMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementRefMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementRefsMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementsMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlTransientMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlValueMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorOrderAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyAttributeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAttachmentRefAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAttributeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementDeclAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementRefAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementRefsAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementWrapperAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementsAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlEnumAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlEnumValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlIDAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlIDREFAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlInlineBinaryDataAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlJavaTypeAdapterAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlJavaTypeAdaptersAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlListAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlMimeTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlMixedAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlRegistryAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlRootElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaTypesAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSeeAlsoAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTransientAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex.JaxbIndexResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops.JaxbPropertiesResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class GenericJaxb_2_1_PlatformDefinition
- extends AbstractJaxbPlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new GenericJaxb_2_1_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
- protected GenericJaxb_2_1_PlatformDefinition() {
- super();
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_1;
- }
-
- public JaxbFactory getFactory() {
- return GenericJaxb_2_1_Factory.instance();
- }
-
- @Override
- protected Map<String, String> buildJavaToSchemaTypes() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("boolean", "boolean");
- map.put("java.lang.Boolean", "boolean");
- map.put("byte", "byte");
- map.put("java.lang.Byte", "byte");
- map.put("short", "short");
- map.put("java.lang.Short", "short");
- map.put("int", "int");
- map.put("java.lang.Integer", "int");
- map.put("long", "long");
- map.put("java.lang.Long", "long");
- map.put("float", "float");
- map.put("java.lang.Float", "float");
- map.put("double", "double");
- map.put("java.lang.Double", "double");
- map.put("java.lang.String", "string");
- map.put("java.math.BigInteger", "integer");
- map.put("java.math.BigDecimal", "decimal");
- map.put("java.util.Calendar", "dateTime");
- map.put("java.util.Date", "dateTime");
- map.put("javax.xml.namespace.QName", "QName");
- map.put("java.net.URI", "string");
- map.put("javax.xml.datatype.XMLGregorianCalendar", "anySimpleType");
- map.put("javax.xml.datatype.Duration", "duration");
- map.put("java.lang.Object", "anyType");
- map.put("java.awt.Image", "base64Binary");
- map.put("javax.activation.DataHandler", "base64Binary");
- map.put("javax.xml.transform.Source", "base64Binary");
- map.put("java.util.UUID", "string");
- return map;
- }
-
- @Override
- protected JaxbResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JaxbResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JavaPackageInfoResourceModelProvider.instance(),
- JaxbIndexResourceModelProvider.instance(),
- JaxbPropertiesResourceModelProvider.instance()};
- }
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
- }
- throw new IllegalArgumentException(contentType.toString());
- }
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return new AnnotationDefinition[] {
- XmlAccessorOrderAnnotationDefinition.instance(),
- XmlAccessorTypeAnnotationDefinition.instance(),
- XmlAnyAttributeAnnotationDefinition.instance(),
- XmlAnyElementAnnotationDefinition.instance(),
- XmlAttachmentRefAnnotationDefinition.instance(),
- XmlAttributeAnnotationDefinition.instance(),
- XmlElementAnnotationDefinition.instance(),
- XmlElementDeclAnnotationDefinition.instance(),
- XmlElementRefAnnotationDefinition.instance(),
- XmlElementRefsAnnotationDefinition.instance(),
- XmlElementsAnnotationDefinition.instance(),
- XmlElementWrapperAnnotationDefinition.instance(),
- XmlEnumAnnotationDefinition.instance(),
- XmlEnumValueAnnotationDefinition.instance(),
- XmlIDAnnotationDefinition.instance(),
- XmlIDREFAnnotationDefinition.instance(),
- XmlInlineBinaryDataAnnotationDefinition.instance(),
- XmlJavaTypeAdaptersAnnotationDefinition.instance(),
- XmlListAnnotationDefinition.instance(),
- XmlMimeTypeAnnotationDefinition.instance(),
- XmlMixedAnnotationDefinition.instance(),
- XmlRegistryAnnotationDefinition.instance(),
- XmlRootElementAnnotationDefinition.instance(),
- XmlSchemaAnnotationDefinition.instance(),
- XmlSchemaTypesAnnotationDefinition.instance(),
- XmlSeeAlsoAnnotationDefinition.instance(),
- XmlTransientAnnotationDefinition.instance(),
- XmlTypeAnnotationDefinition.instance(),
- XmlValueAnnotationDefinition.instance()};
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return new NestableAnnotationDefinition[] {
- XmlJavaTypeAdapterAnnotationDefinition.instance(),
- XmlSchemaTypeAnnotationDefinition.instance()
- };
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlElementMappingDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlAnyAttributeMappingDefinition.instance());
- definitions.add(JavaXmlAnyElementMappingDefinition.instance());
- definitions.add(JavaXmlAttributeMappingDefinition.instance());
- definitions.add(JavaXmlElementMappingDefinition.instance());
- definitions.add(JavaXmlElementRefMappingDefinition.instance());
- definitions.add(JavaXmlElementRefsMappingDefinition.instance());
- definitions.add(JavaXmlElementsMappingDefinition.instance());
- definitions.add(JavaXmlTransientMappingDefinition.instance());
- definitions.add(JavaXmlValueMappingDefinition.instance());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java
deleted file mode 100644
index a8a235bdc8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class GenericJaxb_2_1_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return GenericJaxb_2_1_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java
deleted file mode 100644
index 50df9e2c93..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class GenericJaxb_2_2_PlatformDefinition
- extends GenericJaxb_2_1_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new GenericJaxb_2_2_PlatformDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected GenericJaxb_2_2_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_2;
- }
-
- @Override
- public JaxbFactory getFactory() {
- return GenericJaxb_2_1_Factory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java
deleted file mode 100644
index 14944e74e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class GenericJaxb_2_2_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return GenericJaxb_2_2_PlatformDefinition.instance();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 87d08f80ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderInstallOperationConfig;
-
-
-public class JaxbJreLibraryProviderInstallOperationConfig
- extends LibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbJreLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- if (old != jaxbPlatform) {
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
- }
-
- @Override
- public synchronized IStatus validate() {
- IStatus status = super.validate();
- if (! status.isOK()) {
- return status;
- }
-
- for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
- status = libraryValidator.validate(this);
- if (! status.isOK()) {
- return status;
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
deleted file mode 100644
index 0fede72a1b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-/**
- * Factory to build Dali adapters for an {@link JaxbLibraryProviderInstallOperationConfig}:<ul>
- * <li>{@link JaxbPlatformDescription}
- * </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
- */
-public class JaxbLibraryProviderInstallOperationConfigAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JaxbPlatformDescription.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof JaxbLibraryProviderInstallOperationConfig) {
- return this.getAdapter((JaxbLibraryProviderInstallOperationConfig) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(JaxbLibraryProviderInstallOperationConfig config, Class<?> adapterType) {
- if (adapterType == JaxbPlatformDescription.class) {
- return config.getJaxbPlatform();
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 1b6769914d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.jpt.common.core.internal.libprov.JptOsgiBundlesLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class JaxbOsgiBundlesLibraryProviderInstallOperationConfig
- extends JptOsgiBundlesLibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbOsgiBundlesLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 39349ca701..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.jpt.common.core.internal.libprov.JptUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class JaxbUserLibraryProviderInstallOperationConfig
- extends JptUserLibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbUserLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
deleted file mode 100644
index 4ec0fc3238..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-
-public class GenericEclipseLinkBundlesLibraryValidator
-// extends AbstractOsgiBundlesLibraryValidator
- {
-
-// public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-// JpaOsgiBundlesLibraryProviderInstallOperationConfig jpaConfig
-// = (JpaOsgiBundlesLibraryProviderInstallOperationConfig) config;
-// Map<String, VersionRange[]> bundleVersionRanges = new HashMap<String, VersionRange[]>();
-// String bundleName = "javax.persistence"; //$NON-NLS-1$
-// VersionRange[] versionRanges = new VersionRange[0];
-// if (config.getProjectFacetVersion().equals(JpaFacet.VERSION_1_0)) {
-// versionRanges = new VersionRange[] {new VersionRange("[1.0, 3.0)")}; //$NON-NLS-1$
-// }
-// else if (config.getProjectFacetVersion().equals(JpaFacet.VERSION_2_0)) {
-// versionRanges = new VersionRange[] {new VersionRange("[2.0, 3.0)")}; //$NON-NLS-1$
-// }
-// bundleVersionRanges.put(bundleName, versionRanges);
-// return validate(jpaConfig, bundleVersionRanges);
-// }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
deleted file mode 100644
index c4abe11d02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jpt.common.core.internal.libval.LibValUtil;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class GenericJaxbUserLibraryValidator
- implements LibraryValidator {
-
- public synchronized IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-
- JaxbUserLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbUserLibraryProviderInstallOperationConfig) config;
-
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
- IProjectFacetVersion javaVersion = JaxbLibValUtil.getJavaVersion(jaxbConfig);
- IProjectFacetVersion javaJaxbVersion = JaxbLibValUtil.findJavaJaxbVersion(jaxbConfig);
-
- Iterable<IPath> libraryPaths =
- new TransformationIterable<IClasspathEntry, IPath>(jaxbConfig.resolve()) {
- @Override
- protected IPath transform(IClasspathEntry o) {
- return o.getPath();
- }
- };
-
- // dev-time portion of validation - error if actual java library *conflicts with* jaxb facet
- // or if library does not provide supplemental classes
-
- IProjectFacetVersion jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
-
- // null here implies something prior to jaxb 2.1
- if (jreJaxbVersion != null) {
- if (jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
- }
- // if jre is enough for jaxb version, we don't look for classes in the library
- else {
- Set<String> classNames = new HashSet<String>();
-
- classNames.add("javax.xml.bind.annotation.XmlSeeAlso"); //$NON-NLS-1$
- if (jaxbVersion.compareTo(JaxbFacet.VERSION_2_2) >= 0) {
- classNames.add("javax.xml.bind.JAXBPermission"); //$NON-NLS-1$
- }
-
- IStatus status = LibValUtil.validate(libraryPaths, classNames);
-
- if (! status.isOK()) {
- return status;
- }
- }
-
- // runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
- // user may override implementation manually, however
- // assume 1.6 runtime environs are latest (with jaxb 2.1, not 2.0)
-
- // null here implies something prior to jaxb 2.1
- if (javaJaxbVersion != null && javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
deleted file mode 100644
index 7701da3606..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbJreLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-
- JaxbLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbLibraryProviderInstallOperationConfig) config;
-
- if (! jaxbConfig.getJaxbPlatform().getGroup().equals(GenericJaxbPlatform.GROUP)) {
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, JptJaxbCoreMessages.JreLibraryValidator_invalidPlatform);
- }
-
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
- IProjectFacetVersion javaVersion = JaxbLibValUtil.getJavaVersion(jaxbConfig);
- IProjectFacetVersion javaJaxbVersion = JaxbLibValUtil.findJavaJaxbVersion(jaxbConfig);
-
- // dev-time portion of validation - error if actual java library does not support jaxb facet
-
- IProjectFacetVersion jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
-
- // null here implies something prior to jaxb 2.1
- if (jreJaxbVersion == null || jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- // runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
- // user may override implementation manually, however
- // assume 1.6 runtime environs are latest (with jaxb 2.1, not 2.0)
-
- // null here implies something prior to jaxb 2.1
- if (javaJaxbVersion == null || javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- // TODO - check for xjc classes when we support jdk version of xjc
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
deleted file mode 100644
index ce5d0ab6bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.zip.ZipFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.LibraryLocation;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.common.project.facet.core.StandardJreRuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-
-
-public class JaxbLibValUtil {
-
- static IProjectFacetVersion getJavaVersion(JaxbLibraryProviderInstallOperationConfig config) {
- return config.getFacetedProject().getProjectFacetVersion(JavaFacet.FACET);
- }
-
- /**
- * Return jaxb version determined by java facet version.
- * Assume highest update of java (i.e. java 1.6 maps to jaxb 2.1)
- */
- static IProjectFacetVersion findJavaJaxbVersion(JaxbLibraryProviderInstallOperationConfig config) {
- IProjectFacetVersion javaVersion = getJavaVersion(config);
-
- if (javaVersion == JavaFacet.VERSION_1_6) {
- return JaxbFacet.VERSION_2_1;
- }
- else if (javaVersion == JavaFacet.VERSION_1_7) {
- return JaxbFacet.VERSION_2_2;
- }
-
- return null;
- }
-
- static IProjectFacetVersion findJreJaxbVersion(JaxbLibraryProviderInstallOperationConfig config) {
- IRuntime runtime = config.getFacetedProject().getPrimaryRuntime();
-
- if (runtime != null) {
- for (IRuntimeComponent rc : runtime.getRuntimeComponents()) {
- IVMInstall vm = findVMInstall(rc);
- if (vm != null) {
- return findJreJaxbVersion(vm);
- }
- }
- }
-
- IVMInstall vm = JavaRuntime.getDefaultVMInstall();
-
- IJavaProject javaProject = JavaCore.create(config.getFacetedProject().getProject());
- if (javaProject != null) {
- try {
- vm = JavaRuntime.getVMInstall(javaProject);
- }
- catch (CoreException ce) {
- // do nothing, just use the default install
- }
- }
-
- if (vm != null) {
- return findJreJaxbVersion(vm);
- }
-
- return null;
- }
-
- private static IVMInstall findVMInstall(IRuntimeComponent rc) {
- String vmInstallTypeId
- = rc.getProperty(StandardJreRuntimeComponent.PROP_VM_INSTALL_TYPE);
- String vmInstallId
- = rc.getProperty(StandardJreRuntimeComponent.PROP_VM_INSTALL_ID);
-
- if (vmInstallTypeId == null || vmInstallId == null) {
- return null;
- }
-
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(vmInstallTypeId);
-
- if( vmInstallType == null ) {
- return null;
- }
-
- return vmInstallType.findVMInstall(vmInstallId);
- }
-
- private static IProjectFacetVersion findJreJaxbVersion(IVMInstall vm) {
- if (vm instanceof IVMInstall2) {
- String javaVersion = ((IVMInstall2) vm).getJavaVersion();
- if (javaVersion != null) {
- // all other versions except 1.7 and 1.6 have no corresponding version (as of yet)
- if (javaVersion.startsWith(JavaCore.VERSION_1_7)) {
- return JaxbFacet.VERSION_2_2;
- }
- // 1.6 must be further analyzed
- if (! javaVersion.startsWith(JavaCore.VERSION_1_6)) {
- return null;
- }
- }
- }
-
- Iterable<IPath> vmLibPaths
- = new TransformationIterable<LibraryLocation, IPath>(
- new ArrayIterable<LibraryLocation>(JavaRuntime.getLibraryLocations(vm))) {
- @Override
- protected IPath transform(LibraryLocation o) {
- return o.getSystemLibraryPath();
- }
- };
-
- boolean foundXmlSeeAlso = false; // marker for jaxb 2.1 +
- boolean foundJAXBPermission = false; // marker for jaxb 2.2 +
-
- for (IPath vmLibPath : vmLibPaths) {
- File file = vmLibPath.toFile();
-
- if (file.exists()) {
- ZipFile zip = null;
-
- try {
- zip = new ZipFile(file);
-
- foundXmlSeeAlso |= zip.getEntry("javax/xml/bind/annotation/XmlSeeAlso.class") != null;
- foundJAXBPermission |= zip.getEntry("javax/xml/bind/JAXBPermission.class") != null;
-
- // short circuit for JAXB 2.2
- if (foundJAXBPermission) {
- return JaxbFacet.VERSION_2_2;
- }
- }
- catch (IOException e) {}
- finally {
- if (zip != null) {
- try {
- zip.close();
- }
- catch (IOException e) {}
- }
- }
- }
- }
-
- if (foundXmlSeeAlso) {
- return JaxbFacet.VERSION_2_1;
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java
deleted file mode 100644
index 745ba46411..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.operations;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.core.internal.operations.AbstractJptFileCreationDataModelProvider;
-
-/**
- * SchemaFileCreationDataModelProvider
- */
-public class SchemaFileCreationDataModelProvider extends AbstractJptFileCreationDataModelProvider
-{
-
- @Override
- protected String getDefaultFileName() {
- if(this.getProject() == null) {
- return null;
- }
- return this.getProject().getName();
- }
-
- /**
- * Return a best guess source location for the for the specified project
- */
- @Override
- protected IContainer getDefaultContainer() {
- IContainer defaultContainer = super.getDefaultContainer();
- if(defaultContainer != null) {
- IProject project = (IProject) this.model.getProperty(PROJECT);
- return defaultContainer.getFolder(project.getLocation());
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java
deleted file mode 100644
index 6ca6048f5b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class JaxbPlatformDescriptionImpl
- implements JaxbPlatformDescription {
-
- private String id;
- private String pluginId;
- private String label;
- private String factoryClassName;
- private IProjectFacetVersion jaxbFacetVersion;
- private boolean default_ = false;
- private JaxbPlatformGroupDescriptionImpl group;
-
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- void setLabel(String label) {
- this.label = label;
- }
-
- public String getFactoryClassName() {
- return this.factoryClassName;
- }
-
- void setFactoryClassName(String className) {
- this.factoryClassName = className;
- }
-
- public IProjectFacetVersion getJaxbFacetVersion() {
- return this.jaxbFacetVersion;
- }
-
- void setJaxbFacetVersion(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- this.jaxbFacetVersion = jaxbFacetVersion;
- }
-
- public boolean supportsJaxbFacetVersion(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- return (this.jaxbFacetVersion != null) ? this.jaxbFacetVersion.equals(jaxbFacetVersion) : true;
- }
-
- public boolean isDefault() {
- return this.default_;
- }
-
- void setDefault(boolean default_) {
- this.default_ = default_;
- }
-
- public JaxbPlatformGroupDescription getGroup() {
- return this.group;
- }
-
- void setGroup(JaxbPlatformGroupDescriptionImpl group) {
- this.group = group;
- }
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- JaxbPlatformDefinitionFactory factory = XPointTools.instantiate(
- this.pluginId, JaxbPlatformManagerImpl.QUALIFIED_EXTENSION_POINT_ID,
- this.factoryClassName, JaxbPlatformDefinitionFactory.class);
- return factory.buildJaxbPlatformDefinition();
- }
-
- @Override
- public String toString() {
- return this.label;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java
deleted file mode 100644
index e3e83ad95d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-
-public class JaxbPlatformGroupDescriptionImpl
- implements JaxbPlatformGroupDescription {
-
- private String id;
- private String pluginId;
- private String label;
- private Map<String, JaxbPlatformDescriptionImpl> platforms;
-
-
- JaxbPlatformGroupDescriptionImpl() {
- this.platforms = new HashMap<String, JaxbPlatformDescriptionImpl>();
- }
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- void setLabel(String label) {
- this.label = label;
- }
-
- void addPlatform(JaxbPlatformDescriptionImpl platform) {
- this.platforms.put(platform.getId(), platform);
- }
-
- public Iterable<JaxbPlatformDescription> getPlatforms() {
- return new SuperIterableWrapper<JaxbPlatformDescription>(CollectionTools.collection(this.platforms.values()));
- }
-
- @Override
- public String toString() {
- return this.label;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
deleted file mode 100644
index 978a21cb8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.GenericAnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public final class JaxbPlatformImpl
- implements JaxbPlatform {
-
- private JaxbPlatformDefinition platformDefinition;
-
- private AnnotationProvider annotationProvider;
-
-
- public JaxbPlatformImpl(JaxbPlatformDefinition jaxbPlatformDefinition) {
- super();
- this.platformDefinition = jaxbPlatformDefinition;
- this.annotationProvider = new GenericAnnotationProvider(this.platformDefinition.getAnnotationDefinitions(), this.platformDefinition.getNestableAnnotationDefinitions());
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return this.platformDefinition.getDescription();
- }
-
- public JaxbPlatformDefinition getDefinition() {
- return this.platformDefinition;
- }
-
- // ********** factory **********
-
- public JaxbFactory getFactory() {
- return this.platformDefinition.getFactory();
- }
-
-
- // ********** JAXB file/resource models **********
-
- public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return (contentType == null) ? null : this.buildJaxbFile(jaxbProject, file, contentType);
- }
-
- protected JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType) {
- JptResourceModel resourceModel = this.buildResourceModel(jaxbProject, file, contentType);
- return (resourceModel == null) ? null : getFactory().buildJaxbFile(jaxbProject, file, contentType, resourceModel);
- }
-
- protected JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file, IContentType contentType) {
- JaxbResourceModelProvider provider = this.getResourceModelProvider(contentType);
- return (provider == null) ? null : provider.buildResourceModel(jaxbProject, file);
- }
-
- /**
- * Return null if we don't have a provider for the specified content type
- * (since we don't have control over the possible content types).
- */
- protected JaxbResourceModelProvider getResourceModelProvider(IContentType contentType) {
- for (JaxbResourceModelProvider provider : getResourceModelProviders()) {
- if (contentType.equals(provider.getContentType())) {
- return provider;
- }
- }
- return null;
- }
-
- protected ListIterable<JaxbResourceModelProvider> getResourceModelProviders() {
- return this.platformDefinition.getResourceModelProviders();
- }
-
-
- // ********** Java annotations **********
-
- public AnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return DefaultAnnotationEditFormatter.instance();
- }
-
-
- // ********** Java attribute mappings **********
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(
- JaxbPersistentAttribute attribute) {
- for (JavaAttributeMappingDefinition definition : getSpecifiedJavaAttributeMappingDefinitions()) {
- if (definition.isSpecified(attribute)) {
- return definition;
- }
- }
- throw new IllegalStateException("There must be a mapping definition for all attributes"); //$NON-NLS-1$
- }
-
- public Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions() {
- return this.platformDefinition.getSpecifiedJavaAttributeMappingDefinitions();
- }
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey) {
- for (JavaAttributeMappingDefinition definition : getSpecifiedJavaAttributeMappingDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions() {
- return this.platformDefinition.getDefaultJavaAttributeMappingDefinitions();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
deleted file mode 100644
index e619fc47e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbPlatformManagerImpl
- implements JaxbPlatformManager {
-
- static final String EXTENSION_POINT_ID = "jaxbPlatforms"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbCorePlugin.PLUGIN_ID_ + EXTENSION_POINT_ID;
- static final String PLATFORM_GROUP_ELEMENT = "jaxbPlatformGroup"; //$NON-NLS-1$
- static final String PLATFORM_ELEMENT = "jaxbPlatform"; //$NON-NLS-1$
- static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- static final String LABEL_ATTRIBUTE = "label"; //$NON-NLS-1$
- static final String FACTORY_CLASS_ATTRIBUTE = "factoryClass"; //$NON-NLS-1$
- static final String JAXB_FACET_VERSION_ATTRIBUTE = "jaxbFacetVersion"; //$NON-NLS-1$
- static final String DEFAULT_ATTRIBUTE = "default"; //$NON-NLS-1$
- static final String GROUP_ELEMENT = "group"; //$NON-NLS-1$
-
-
- private static final JaxbPlatformManagerImpl INSTANCE = new JaxbPlatformManagerImpl();
-
-
- public static JaxbPlatformManagerImpl instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, JaxbPlatformGroupDescriptionImpl> platformGroupDescriptions;
- private KeyedSet<String, JaxbPlatformDescriptionImpl> platformDescriptions;
-
-
- // ********** constructor/initialization **********
-
- private JaxbPlatformManagerImpl() {
- super();
- this.platformGroupDescriptions = new KeyedSet<String, JaxbPlatformGroupDescriptionImpl>();
- this.platformDescriptions = new KeyedSet<String, JaxbPlatformDescriptionImpl>();
- readExtensions();
- }
-
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbCorePlugin.PLUGIN_ID, EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- List<IConfigurationElement> platformGroupConfigs = new ArrayList<IConfigurationElement>();
- List<IConfigurationElement> platformConfigs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement element : extension.getConfigurationElements()) {
- if (element.getName().equals(PLATFORM_GROUP_ELEMENT)) {
- platformGroupConfigs.add(element);
- }
- else if (element.getName().equals(PLATFORM_ELEMENT)) {
- platformConfigs.add(element);
- }
- }
- }
-
- for (IConfigurationElement element : platformGroupConfigs) {
- readPlatformGroupExtension(element);
- }
-
- for (IConfigurationElement element : platformConfigs) {
- readPlatformExtension(element);
- }
- }
-
- private void readPlatformGroupExtension(IConfigurationElement element) {
- try {
- final JaxbPlatformGroupDescriptionImpl desc = new JaxbPlatformGroupDescriptionImpl();
-
- // plug-in id
- desc.setPluginId(element.getContributor().getName());
-
- // id
- desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformGroupDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
- throw new XPointException();
- }
-
- // label
- desc.setLabel(findRequiredAttribute(element, LABEL_ATTRIBUTE));
-
- this.platformGroupDescriptions.addItem(desc.getId(), desc);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
- private void readPlatformExtension(IConfigurationElement element) {
- try {
- final JaxbPlatformDescriptionImpl desc = new JaxbPlatformDescriptionImpl();
-
- // plug-in id
- desc.setPluginId(element.getContributor().getName());
-
- // id
- desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
- throw new XPointException();
- }
-
- // label
- desc.setLabel(findRequiredAttribute(element, LABEL_ATTRIBUTE));
-
- // factory class
- desc.setFactoryClassName(findRequiredAttribute(element, FACTORY_CLASS_ATTRIBUTE));
-
- // JAXB facet version
- String jaxbFacetVersionString = element.getAttribute(JAXB_FACET_VERSION_ATTRIBUTE);
- if (jaxbFacetVersionString != null) {
- IProjectFacetVersion jpaFacetVersion = JaxbFacet.FACET.getVersion(jaxbFacetVersionString);
- if (jpaFacetVersion != null) {
- desc.setJaxbFacetVersion(jpaFacetVersion);
- }
- else {
- logInvalidValue(element, JAXB_FACET_VERSION_ATTRIBUTE, jaxbFacetVersionString);
- throw new XPointException();
- }
- }
-
- // default
- String defaultString = element.getAttribute(DEFAULT_ATTRIBUTE);
- if (defaultString != null) {
- if (defaultString.equals("true")) { //$NON-NLS-1$
- desc.setDefault(true);
- }
- else if (defaultString.equals("false")) { //$NON-NLS-1$
- desc.setDefault(false);
- }
- else {
- logInvalidValue(element, DEFAULT_ATTRIBUTE, defaultString);
- throw new XPointException();
- }
- }
-
- // group
- String groupId = element.getAttribute(GROUP_ELEMENT);
- if (groupId != null) {
- JaxbPlatformGroupDescriptionImpl group = this.platformGroupDescriptions.getItem(groupId);
- if (group != null) {
- desc.setGroup(group);
- group.addPlatform(desc);
- }
- else {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
- throw new XPointException();
- }
- }
- else {
- JaxbPlatformGroupDescriptionImpl group = new JaxbPlatformGroupDescriptionImpl();
- group.setPluginId(desc.getPluginId());
- group.setId(desc.getId());
- group.setLabel(desc.getLabel());
- group.addPlatform(desc);
-
- if (this.platformGroupDescriptions.containsKey(group.getId())) {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
- throw new XPointException();
- }
-
- this.platformGroupDescriptions.addItem(group.getId(), group);
- }
-
- this.platformDescriptions.addItem(desc.getId(), desc);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
-
- // ********** public methods **********
-
- public Iterable<JaxbPlatformGroupDescription> getJaxbPlatformGroups() {
- return new SuperIterableWrapper<JaxbPlatformGroupDescription>(this.platformGroupDescriptions.getItemSet());
- }
-
- public JaxbPlatformGroupDescription getJaxbPlatformGroup(String groupId) {
- return this.platformGroupDescriptions.getItem(groupId);
- }
-
- public Iterable<JaxbPlatformDescription> getJaxbPlatforms() {
- return new SuperIterableWrapper<JaxbPlatformDescription>(this.platformDescriptions.getItemSet());
- }
-
- public JaxbPlatformDescription getJaxbPlatform(String platformId) {
- return this.platformDescriptions.getItem(platformId);
- }
-
- public JaxbPlatformDescription getDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- for (JaxbPlatformDescription platform : getJaxbPlatforms()) {
- if (platform.isDefault() && platform.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return platform;
- }
- }
- return null;
- }
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition(IProject project) {
- String jaxbPlatformId = JptJaxbCorePlugin.getJaxbPlatformId(project);
- JaxbPlatformDescriptionImpl platformDesc = this.platformDescriptions.getItem(jaxbPlatformId);
- if (platformDesc == null) {
- throw new IllegalArgumentException("Project does not have a recognized JAXB platform."); //$NON-NLS-1$
- }
- return platformDesc.buildJaxbPlatformDefinition();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
deleted file mode 100644
index 599dc4e1ac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-/**
- * Property tester for {@link JaxbPlatformDescription}.
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>
- */
-public class JaxbPlatformTester
- extends PropertyTester
-{
- public static final String JAXB_PLATFORM = "jaxbPlatform"; //$NON-NLS-1$
- public static final String JAXB_PLATFORM_GROUP = "jaxbPlatformGroup"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof JaxbPlatformDescription) {
- return this.test((JaxbPlatformDescription) receiver, property, expectedValue);
- }
- return false;
- }
-
- private boolean test(JaxbPlatformDescription platform, String property, Object expectedValue) {
- if (property.equals(JAXB_PLATFORM)) {
- JaxbPlatformDescription expected = this.getJaxbPlatform(expectedValue);
- return Tools.valuesAreEqual(platform, expected);
- }
- if (property.equals(JAXB_PLATFORM_GROUP)) {
- JaxbPlatformGroupDescription expected = this.getJaxbPlatformGroup(expectedValue);
- return Tools.valuesAreEqual(platform.getGroup(), expected);
- }
- return false;
- }
-
- private JaxbPlatformDescription getJaxbPlatform(Object id) {
- return JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform((String) id);
- }
-
- private JaxbPlatformGroupDescription getJaxbPlatformGroup(Object id) {
- return JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup((String) id);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
deleted file mode 100644
index cdbc71baf4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 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
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.prefs;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * JaxbPreferencesManager
- */
-public class JaxbPreferencesManager
-{
- private final IProject project;
-
- private static volatile boolean flushPreferences = true;
-
- // ********** public constants **********
-
- /**
- * The node for storing a JAXB project's platform in the project's preferences.
- */
- protected static final String PLATFORM_PREF_NODE = "platform"; //$NON-NLS-1$
-
- /**
- * The key for storing the platform id
- */
- protected static final String PLATFORM_ID_PREF_KEY = "platform-id"; //$NON-NLS-1$
-
- /**
- * The key for storing the default JAXB platform ID for JAXB 2.1 in the workspace preferences.
- */
- public static final String DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY =
- "defaultJaxbPlatform_" + JaxbFacet.VERSION_2_1.getVersionString(); //$NON-NLS-1$
-
- /**
- * The key for storing the default JAXB platform ID for JAXB 2.2 in the workspace preferences.
- */
- public static final String DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY =
- "defaultJaxbPlatform_" + JaxbFacet.VERSION_2_2.getVersionString(); //$NON-NLS-1$
-
- /**
- * The node for storing a JAXB project's schemas in the project's preferences.
- */
- public static final String SCHEMAS_PREF_NODE = "schemas"; //$NON-NLS-1$
-
- /**
- * The node prefix for storing a particular JAXB project schema in the project's preferences.
- * Specific schema nodes are followed by integers ("schema-1", "schema-2", etc.)
- */
- public static final String SCHEMA_PREF_NODE_PREFIX = "schema-"; //$NON-NLS-1$
-
- /**
- * The key for storing a schema location (such as a uri or catalog key) in the project's preferences
- */
- public static final String SCHEMA_LOCATION_PREF_KEY = "location"; //$NON-NLS-1$
-
-
- // ********** preferences **********
-
- /**
- * Return the Dali preferences for the specified context.
- */
- private static IEclipsePreferences getPreferences(IScopeContext context) {
- return context.getNode(JptJaxbCorePlugin.PLUGIN_ID);
- }
-
- /**
- * Return the Dali preferences for the current workspace instance.
- */
- public static IEclipsePreferences getWorkspacePreferences() {
- return getPreferences(InstanceScope.INSTANCE);
- }
-
- /**
- * Return the default Dali preferences
- * @see JpaPreferenceInitializer
- */
- public static IEclipsePreferences getDefaultPreferences() {
- return getPreferences(DefaultScope.INSTANCE);
- }
-
- // ********** workspace preference **********
-
- public static void setWorkspacePreference(String key, String value) {
- IEclipsePreferences wkspPrefs = getWorkspacePreferences();
- if(value == null) {
- wkspPrefs.remove(key);
- }
- else {
- wkspPrefs.put(key, value);
- }
- flush(wkspPrefs);
- }
-
- // ********** private static methods **********
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * The preferences end up getting flushed after the test case has deleted
- * its project, resulting in resource exceptions in the log, e.g.
- * <pre>
- * Resource '/JpaProjectManagerTests' is not open.
- * </pre>
- * See <code>JptJaxbCoreTestsPlugin.start(BundleContext)</code>
- */
- @SuppressWarnings("unused")
- private static void doNotFlushPreferences() {
- flushPreferences = false;
- }
-
- /**
- * Flush preferences in an asynchronous Job because the flush request will
- * trigger a lock on the project, which can cause us some deadlocks (e.g.
- * when deleting the metamodel source folder).
- * Note: the flush will also remove the prefs node if it is empty
- */
- private static void flush(IEclipsePreferences prefs) {
- if (flushPreferences) {
- new PreferencesFlushJob(prefs).schedule();
- }
- }
-
- private static class PreferencesFlushJob extends Job {
- private final IEclipsePreferences prefs;
- PreferencesFlushJob(IEclipsePreferences prefs) {
- super(NLS.bind(JptJaxbCoreMessages.PREFERENCES_FLUSH_JOB_NAME, prefs.absolutePath()));
- this.prefs = prefs;
- }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- prefs.flush();
- }
- catch(BackingStoreException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- return Status.OK_STATUS;
- }
- }
-
- // ********** implementation **************************************************
-
- public JaxbPreferencesManager(IProject project) {
- if(project == null) {
- throw new RuntimeException("Project is null"); //$NON-NLS-1$
- }
- this.project = project;
- }
-
- // ********** preferences **********
-
- protected Preferences getProjectPreferences() {
- try {
- IFacetedProject fproj = ProjectFacetsManager.create(this.project);
- return fproj.getPreferences(JaxbFacet.FACET);
- }
- catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
- }
- catch (CoreException ce) {
- JptJaxbCorePlugin.log(ce);
- }
- return null;
- }
-
- // ********** getters/setters *********
-
- /**
- * Return the JAXB platform ID associated with the specified Eclipse project.
- */
- public String getJaxbPlatformId() {
- Preferences prefs = this.getProjectPreferences();
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- return platformPrefs.get(PLATFORM_ID_PREF_KEY, GenericJaxbPlatform.VERSION_2_1.getId());
- }
-
- /**
- * Set the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public void setJaxbPlatform(JaxbPlatformDescription platform) {
- Preferences prefs = this.getProjectPreferences();
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- platformPrefs.put(PLATFORM_ID_PREF_KEY, platform.getId());
- try {
- platformPrefs.flush();
- }
- catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
- }
- }
-
- public List<String> getSchemaLocations() {
- List<String> schemaLocations = new Vector<String>();
- Preferences prefs = this.getProjectPreferences();
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- boolean checkAnotherNode = true;
- for (int i = 1; checkAnotherNode; i++ ) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- if (schemasPrefs.nodeExists(nodeName)) {
- Preferences schemaPrefs = schemasPrefs.node(nodeName);
- String location = schemaPrefs.get(SCHEMA_LOCATION_PREF_KEY, null);
- if (location != null) {
- schemaLocations.add(location);
- }
- }
- else {
- checkAnotherNode = false;
- }
- }
- }
- catch (BackingStoreException bse) {
- // this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
- }
- return schemaLocations;
- }
-
- public void setSchemaLocations(List<String> schemaLocations) {
- Preferences prefs = this.getProjectPreferences();
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- int i = 1;
- for (String location : schemaLocations) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- Preferences schemaPref = schemasPrefs.node(nodeName);
- schemaPref.put(SCHEMA_LOCATION_PREF_KEY, location);
- i ++;
- }
- boolean checkAnotherNode = true;
- for ( ; checkAnotherNode; i++ ) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- if (schemasPrefs.nodeExists(nodeName)) {
- schemasPrefs.node(nodeName).removeNode();
- }
- else {
- checkAnotherNode = false;
- }
- }
- schemasPrefs.flush();
- }
- catch (BackingStoreException bse) {
- // this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
deleted file mode 100644
index 8df576788f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource;
-
-import java.io.BufferedInputStream;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-public abstract class AbstractJaxbFileResourceModel<S>
- implements JptResourceModel
-{
- protected final IFile file;
-
- /**
- * This is <code>null</code> if there is no package name.
- */
- protected final String packageName;
-
- protected final S state;
-
- protected final ListenerList<JptResourceModelListener> resourceModelListenerList =
- new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
-
-
- protected AbstractJaxbFileResourceModel(IFile file) {
- super();
- if (file == null) {
- throw new NullPointerException();
- }
- this.file = file;
- this.packageName = this.buildPackageName();
- this.state = this.buildState();
- this.load();
- }
-
- protected String buildPackageName() {
- String pkg = this.buildPackageName_();
- return StringTools.stringIsEmpty(pkg) ? null : pkg;
- }
-
- protected String buildPackageName_() {
- IJavaElement javaElement = JavaCore.create(this.file.getParent());
- if ((javaElement != null) && (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT)) {
- return ((IPackageFragment) javaElement).getElementName();
- }
- return null;
- }
-
- protected abstract S buildState();
-
- public String getPackageName() {
- return this.packageName;
- }
-
- protected void reload() {
- this.load();
- }
-
- protected void load() {
- InputStream stream = null;
- try {
- stream = this.file.getContents();
- if (stream != null) {
- this.load(new BufferedInputStream(stream));
- }
- }
- catch (CoreException ce) {
- // workspace out of sync - no underlying file - simply don't load
- }
- catch (Exception ex) {
- JptJaxbCorePlugin.log(ex);
- }
- finally {
- this.closeStream(stream);
- }
- }
-
- /**
- * The specified stream is not <code>null</code>.
- */
- protected abstract void load(InputStream stream) throws IOException;
-
- protected void closeStream(Closeable stream) {
- try {
- if (stream != null) {
- stream.close();
- }
- } catch (IOException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- public void update() {
- this.reload();
- this.resourceModelChanged();
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public IFile getFile() {
- return this.file;
- }
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
- protected void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java
deleted file mode 100644
index 84d2402975..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class NullXmlAccessorOrderAnnotation
- extends NullAnnotation
- implements XmlAccessorOrderAnnotation
-{
- protected NullXmlAccessorOrderAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- @Override
- protected XmlAccessorOrderAnnotation addAnnotation() {
- return (XmlAccessorOrderAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlAccessorTOrderAnnotation implementation **********
-
- // ***** value
- public XmlAccessOrder getValue() {
- return null;
- }
-
- public void setValue(XmlAccessOrder value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 18248a0e9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class NullXmlAccessorTypeAnnotation
- extends NullAnnotation
- implements XmlAccessorTypeAnnotation
-{
- protected NullXmlAccessorTypeAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- @Override
- protected XmlAccessorTypeAnnotation addAnnotation() {
- return (XmlAccessorTypeAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlAccessorTypeAnnotation implementation **********
-
- // ***** value
- public XmlAccessType getValue() {
- return null;
- }
-
- public void setValue(XmlAccessType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
deleted file mode 100644
index 5f22fae013..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class NullXmlEnumAnnotation
- extends NullAnnotation
- implements XmlEnumAnnotation
-{
- protected NullXmlEnumAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- @Override
- protected XmlEnumAnnotation addAnnotation() {
- return (XmlEnumAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public String getFullyQualifiedValueClassName() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
deleted file mode 100644
index ba178b4fda..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class NullXmlEnumValueAnnotation
- extends NullAnnotation
- implements XmlEnumValueAnnotation
-{
- protected NullXmlEnumValueAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- @Override
- protected XmlEnumValueAnnotation addAnnotation() {
- return (XmlEnumValueAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
deleted file mode 100644
index 7c2cc3bacf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchema
- */
-public final class NullXmlSchemaAnnotation
- extends NullAnnotation
- implements XmlSchemaAnnotation
-{
- protected NullXmlSchemaAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- @Override
- protected XmlSchemaAnnotation addAnnotation() {
- return (XmlSchemaAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlSchemaAnnotation implementation **********
-
- // ***** namespace
-
- public String getNamespace() {
- return null;
- }
-
- public void setNamespace(String namespace) {
- if (namespace != null) {
- this.addAnnotation().setNamespace(namespace);
- }
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** location
-
- public String getLocation() {
- return null;
- }
-
- public void setLocation(String location) {
- if (location != null) {
- this.addAnnotation().setLocation(location);
- }
- }
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public XmlNsForm getAttributeFormDefault() {
- return null;
- }
-
- public void setAttributeFormDefault(XmlNsForm attributeFormDefault) {
- if (attributeFormDefault != null) {
- this.addAnnotation().setAttributeFormDefault(attributeFormDefault);
- }
- }
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public XmlNsForm getElementFormDefault() {
- return null;
- }
-
- public void setElementFormDefault(XmlNsForm elementFormDefault) {
- if (elementFormDefault != null) {
- this.addAnnotation().setElementFormDefault(elementFormDefault);
- }
- }
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public ListIterable<XmlNsAnnotation> getXmlns() {
- return EmptyListIterable.instance();
- }
-
- public int getXmlnsSize() {
- return 0;
- }
-
- public XmlNsAnnotation xmlnsAt(int index) {
- return null;
- }
-
- public XmlNsAnnotation addXmlns(int index) {
- return this.addAnnotation().addXmlns(index);
- }
-
- public void moveXmlns(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlns(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
deleted file mode 100644
index 848b54d55f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class NullXmlTypeAnnotation
- extends NullAnnotation
- implements XmlTypeAnnotation
-{
- protected NullXmlTypeAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- @Override
- protected XmlTypeAnnotation addAnnotation() {
- return (XmlTypeAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factory class
- public String getFactoryClass() {
- return null;
- }
-
- public String getFullyQualifiedFactoryClassName() {
- return null;
- }
-
- public void setFactoryClass(String factoryClass) {
- if (factoryClass != null) {
- this.addAnnotation().setFactoryClass(factoryClass);
- }
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** factory method
- public String getFactoryMethod() {
- return null;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- if (factoryMethod != null) {
- this.addAnnotation().setFactoryMethod(factoryMethod);
- }
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** name
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- this.addAnnotation().setName(name);
- }
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return null;
- }
-
- public void setNamespace(String namespace) {
- if (namespace != null) {
- this.addAnnotation().setNamespace(namespace);
- }
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- public ListIterable<String> getPropOrder() {
- return EmptyListIterable.instance();
- }
-
- public int getPropOrderSize() {
- return 0;
- }
-
- public void addProp(int index, String prop) {
- this.addAnnotation().addProp(index, prop);
- }
-
- public void addProp(String prop) {
- this.addAnnotation().addProp(prop);
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(String prop) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return null;
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
deleted file mode 100644
index e36e86637d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class XmlAccessorOrderAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAccessorOrderAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAccessorOrderAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAccessorOrderAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlAccessorOrderAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAccessorOrderAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
deleted file mode 100644
index ef3bea4831..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class XmlAccessorTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAccessorTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAccessorTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAccessorTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlAccessorTypeAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAccessorTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
deleted file mode 100644
index 2156137c02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class XmlAnyAttributeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAnyAttributeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAnyAttributeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyAttributeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyAttributeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
deleted file mode 100644
index 19fe6dfbb0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class XmlAnyElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAnyElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAnyElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyElementAnnotation(parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
deleted file mode 100644
index e457919225..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class XmlAttachmentRefAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAttachmentRefAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAttachmentRefAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttachmentRefAnnotation(parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttachmentRefAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
deleted file mode 100644
index 7b4020e09f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class XmlAttributeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAttributeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAttributeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttributeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttributeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
deleted file mode 100644
index 47928a5ec7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class XmlElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementAnnotation.buildSourceXmlElementAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
deleted file mode 100644
index cfabd0c30f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class XmlElementDeclAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementDeclAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementDeclAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementDeclAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementDeclAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
deleted file mode 100644
index 742aa7d549..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class XmlElementRefAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementRefAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementRefAnnotation.buildSourceXmlElementRefAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
deleted file mode 100644
index c76018b384..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class XmlElementRefsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementRefsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementRefsAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefsAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
deleted file mode 100644
index d36abe649d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class XmlElementWrapperAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementWrapperAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementWrapperAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementWrapperAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementWrapperAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
deleted file mode 100644
index 5b070a57cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class XmlElementsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementsAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementsAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
deleted file mode 100644
index ec80a4c62b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class XmlEnumAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlEnumAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlEnumAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
deleted file mode 100644
index 39a765fcec..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class XmlEnumValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlEnumValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlEnumValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumValueAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
deleted file mode 100644
index 4f7b595d89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class XmlIDAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlIDAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlIDAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
deleted file mode 100644
index 99512ab4dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class XmlIDREFAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlIDREFAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlIDREFAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDREFAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDREFAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
deleted file mode 100644
index afcee0493a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryData
- */
-public final class XmlInlineBinaryDataAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlInlineBinaryDataAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlInlineBinaryDataAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInlineBinaryDataAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInlineBinaryDataAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
deleted file mode 100644
index 1e7751e87d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapterAnnotation
- */
-public final class XmlJavaTypeAdapterAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlJavaTypeAdapterAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlJavaTypeAdapterAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS;
- }
-
- public String getElementName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlJavaTypeAdapterAnnotation.buildSourceXmlJavaTypeAdapterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryXmlJavaTypeAdapterAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
deleted file mode 100644
index adef72670c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdaptersAnnotation
- */
-public final class XmlJavaTypeAdaptersAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlJavaTypeAdaptersAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private XmlJavaTypeAdaptersAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
deleted file mode 100644
index 38fdba5caa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class XmlListAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlListAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlListAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlListAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlListAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
deleted file mode 100644
index ec395f8a50..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class XmlMimeTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlMimeTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlMimeTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMimeTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMimeTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
deleted file mode 100644
index 3d5bd69be6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class XmlMixedAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlMixedAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlMixedAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMixedAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMixedAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
deleted file mode 100644
index d0b3fba4a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRegistryAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRegistryAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class XmlRegistryAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlRegistryAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlRegistryAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRegistryAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRegistryAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
deleted file mode 100644
index 58370c5fe8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class XmlRootElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlRootElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlRootElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRootElementAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRootElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
deleted file mode 100644
index 9688c0dea1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlSchema
- */
-public class XmlSchemaAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSchemaAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSchemaAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSchemaAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlSchemaAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- // TODO
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
deleted file mode 100644
index 6fb9f98ae2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class XmlSchemaTypeAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlSchemaTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- private XmlSchemaTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return JAXB.XML_SCHEMA_TYPE;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_SCHEMA_TYPES;
- }
-
- public String getElementName() {
- return JAXB.XML_SCHEMA_TYPES__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlSchemaTypeAnnotation.buildSourceXmlSchemaTypeAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
deleted file mode 100644
index c2c195e18a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdaptersAnnotation
- */
-public final class XmlSchemaTypesAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSchemaTypesAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSchemaTypesAnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA_TYPES;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
deleted file mode 100644
index 65e9d6b490..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class XmlSeeAlsoAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSeeAlsoAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSeeAlsoAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSeeAlsoAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlSeeAlsoAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
deleted file mode 100644
index b273019abe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class XmlTransientAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTransientAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTransientAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransientAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransientAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
deleted file mode 100644
index db0e7b5cfe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class XmlTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlTypeAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
deleted file mode 100644
index 6339a90745..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class XmlValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
deleted file mode 100644
index f686d90601..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class BinaryXmlAccessorOrderAnnotation
- extends BinaryAnnotation
- implements XmlAccessorOrderAnnotation
-{
- private XmlAccessOrder value;
-
-
- public BinaryXmlAccessorOrderAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- //*************** XmlAccessorOrderAnnotation implementation ****************
-
- // ***** value
- public XmlAccessOrder getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessOrder value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(XmlAccessOrder value) {
- XmlAccessOrder old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private XmlAccessOrder buildValue() {
- return XmlAccessOrder.fromJavaAnnotationValue(this.getJdtMemberValue(JAXB.XML_ACCESSOR_ORDER__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 363b4a4fad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class BinaryXmlAccessorTypeAnnotation
- extends BinaryAnnotation
- implements XmlAccessorTypeAnnotation
-{
- private XmlAccessType value;
-
-
- public BinaryXmlAccessorTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- //*************** XmlAccessorTypeAnnotation implementation ****************
-
- // ***** value
- public XmlAccessType getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(XmlAccessType value) {
- XmlAccessType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private XmlAccessType buildValue() {
- return XmlAccessType.fromJavaAnnotationValue(this.getJdtMemberValue(JAXB.XML_ACCESSOR_TYPE__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java
deleted file mode 100644
index 06a7961529..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class BinaryXmlAnyAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAnyAttributeAnnotation
-{
-
- public BinaryXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
deleted file mode 100644
index 0410afb97e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class BinaryXmlAnyElementAnnotation
- extends BinaryAnnotation
- implements XmlAnyElementAnnotation
-{
- private Boolean lax;
- private String value;
-
-
- public BinaryXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.lax = this.buildLax();
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setLax_(this.buildLax());
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlAnyElementAnnotation implementation **********
-
- // ***** lax
- public Boolean getLax() {
- return this.lax;
- }
-
- public void setLax(Boolean lax) {
- throw new UnsupportedOperationException();
- }
-
- private void setLax_(Boolean lax) {
- Boolean old = this.lax;
- this.lax = lax;
- this.firePropertyChanged(LAX_PROPERTY, old, lax);
- }
-
- private Boolean buildLax() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ANY_ELEMENT__LAX);
- }
-
- public TextRange getLaxTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ANY_ELEMENT__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.value;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java
deleted file mode 100644
index 610dce8c81..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class BinaryXmlAttachmentRefAnnotation
- extends BinaryAnnotation
- implements XmlAttachmentRefAnnotation
-{
-
- public BinaryXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
deleted file mode 100644
index 520efc7917..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class BinaryXmlAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAttributeAnnotation
-{
- private String name;
- private String namespace;
- private Boolean required;
-
-
- public BinaryXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setRequired_(this.buildRequired());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlAttributeAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
deleted file mode 100644
index 72721b7d45..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class BinaryXmlElementAnnotation
- extends BinaryAnnotation
- implements XmlElementAnnotation
-{
- private String name;
- private String namespace;
- private String defaultValue;
- private Boolean nillable;
- private Boolean required;
- private String type;
-
-
- public BinaryXmlElementAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.defaultValue = this.buildDefaultValue();
- this.nillable = this.buildNillable();
- this.required = this.buildRequired();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setDefaultValue_(this.buildDefaultValue());
- this.setNillable_(this.buildNillable());
- this.setRequired_(this.buildRequired());
- this.setType_(this.buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** default value
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- private String buildDefaultValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNillable_(Boolean nillable) {
- Boolean old = this.nillable;
- this.nillable = nillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, nillable);
- }
-
- private Boolean buildNillable() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__NILLABLE);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.type;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
deleted file mode 100644
index bf1be28daf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class BinaryXmlElementDeclAnnotation
- extends BinaryAnnotation
- implements XmlElementDeclAnnotation {
-
- private String scope;
- private String namespace;
- private String name;
- private String substitutionHeadNamespace;
- private String substitutionHeadName;
- private String defaultValue;
-
-
- public BinaryXmlElementDeclAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.scope = buildScope();
- this.namespace = buildNamespace();
- this.name = buildName();
- this.substitutionHeadNamespace = buildSubstitutionHeadNamespace();
- this.substitutionHeadName = buildSubstitutionHeadName();
- this.defaultValue = buildDefaultValue();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- @Override
- public void update() {
- super.update();
- setScope_(buildScope());
- setNamespace_(buildNamespace());
- setName_(buildName());
- setSubstitutionHeadNamespace_(buildSubstitutionHeadNamespace());
- setSubstitutionHeadName_(buildSubstitutionHeadName());
- setDefaultValue_(buildDefaultValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- throw new UnsupportedOperationException();
- }
-
- private void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- firePropertyChanged(SCOPE_PROPERTY, old, scope);
- firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, scope);
- }
-
- private String buildScope() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SCOPE);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedScopeClassName() {
- return this.scope;
- }
-
-
- // ***** substitutionHeadNamespace *****
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setSubstitutionHeadNamespace_(String substitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, substitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** substitutionHeadName *****
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- throw new UnsupportedOperationException();
- }
-
- private void setSubstitutionHeadName_(String substitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = substitutionHeadName;
- firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, substitutionHeadName);
- }
-
- private String buildSubstitutionHeadName() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** default value *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- private String buildDefaultValue() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
deleted file mode 100644
index 2a07f8ce03..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class BinaryXmlElementRefAnnotation
- extends BinaryAnnotation
- implements XmlElementRefAnnotation
-{
- private String name;
- private String namespace;
- private Boolean required;
- private String type;
-
-
- public BinaryXmlElementRefAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setRequired_(this.buildRequired());
- this.setType_(this.buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementRefAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.type;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java
deleted file mode 100644
index 7f6ab4b505..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-
-public class BinaryXmlElementRefsAnnotation
- extends BinaryAnnotation
- implements XmlElementRefsAnnotation {
-
- private final Vector<XmlElementRefAnnotation> xmlElementRefs;
-
-
- public BinaryXmlElementRefsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlElementRefs = this.buildXmlElementRefs();
- }
-
-
- private Vector<XmlElementRefAnnotation> buildXmlElementRefs() {
- Object[] jdtXmlElementRefs = this.getJdtMemberValues(JAXB.XML_ELEMENT_REFS__VALUE);
- Vector<XmlElementRefAnnotation> result = new Vector<XmlElementRefAnnotation>(jdtXmlElementRefs.length);
- for (Object jdtXmlElementRef : jdtXmlElementRefs) {
- result.add(new BinaryXmlElementRefAnnotation(this, (IAnnotation) jdtXmlElementRef));
- }
- return result;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() {
- return new LiveCloneListIterable<XmlElementRefAnnotation>(this.xmlElementRefs);
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefs.size();
- }
-
- public XmlElementRefAnnotation xmlElementRefAt(int index) {
- return this.xmlElementRefs.elementAt(index);
- }
-
- public XmlElementRefAnnotation addXmlElementRef(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlElementRef(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
deleted file mode 100644
index 344734465c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class BinaryXmlElementWrapperAnnotation
- extends BinaryAnnotation
- implements XmlElementWrapperAnnotation
-{
- private String name;
- private String namespace;
- private Boolean nillable;
- private Boolean required;
-
-
- public BinaryXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.nillable = this.buildNillable();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setNillable_(this.buildNillable());
- this.setRequired_(this.buildRequired());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementWrapperAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNillable_(Boolean nillable) {
- Boolean old = this.nillable;
- this.nillable = nillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, nillable);
- }
-
- private Boolean buildNillable() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java
deleted file mode 100644
index 47d6f1d24c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElements
- */
-public final class BinaryXmlElementsAnnotation
- extends BinaryAnnotation
- implements XmlElementsAnnotation
-{
- private final Vector<XmlElementAnnotation> xmlElements;
-
-
- public BinaryXmlElementsAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlElements = this.buildXmlElements();
- }
-
- private Vector<XmlElementAnnotation> buildXmlElements() {
- Object[] jdtXmlElements = this.getJdtMemberValues(JAXB.XML_ELEMENTS__VALUE);
- Vector<XmlElementAnnotation> result = new Vector<XmlElementAnnotation>(jdtXmlElements.length);
- for (Object jdtXmlElement : jdtXmlElements) {
- result.add(new BinaryXmlElementAnnotation(this, (IAnnotation) jdtXmlElement));
- }
- return result;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public ListIterable<XmlElementAnnotation> getXmlElements() {
- return new LiveCloneListIterable<XmlElementAnnotation>(this.xmlElements);
- }
-
- public int getXmlElementsSize() {
- return this.xmlElements.size();
- }
-
- public XmlElementAnnotation xmlElementAt(int index) {
- return this.xmlElements.elementAt(index);
- }
-
- public XmlElementAnnotation addXmlElement(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlElement(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
deleted file mode 100644
index eaaff3cf5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class BinaryXmlEnumAnnotation
- extends BinaryAnnotation
- implements XmlEnumAnnotation
-{
- private String value;
-
-
- public BinaryXmlEnumAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnum implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ENUM__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.value;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
deleted file mode 100644
index 53cc480a86..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class BinaryXmlEnumValueAnnotation
- extends BinaryAnnotation
- implements XmlEnumValueAnnotation
-{
-
- private String value;
-
- public BinaryXmlEnumValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ENUM_VALUE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java
deleted file mode 100644
index e40dfa1388..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class BinaryXmlIDAnnotation
- extends BinaryAnnotation
- implements XmlIDAnnotation
-{
-
- public BinaryXmlIDAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java
deleted file mode 100644
index f98361154f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class BinaryXmlIDREFAnnotation
- extends BinaryAnnotation
- implements XmlIDREFAnnotation
-{
-
- public BinaryXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index 02a5486214..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class BinaryXmlInlineBinaryDataAnnotation
- extends BinaryAnnotation
- implements XmlInlineBinaryDataAnnotation {
-
- public BinaryXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 70bdd6bec8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class BinaryXmlJavaTypeAdapterAnnotation
- extends BinaryAnnotation
- implements XmlJavaTypeAdapterAnnotation {
-
- private String value;
-
- private String type;
-
-
- public BinaryXmlJavaTypeAdapterAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = buildValue();
- this.type = buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- @Override
- public void update() {
- super.update();
- setValue_(buildValue());
- setType_(buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlJavaTypeAdapterAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedValue() {
- return this.value;
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedType() {
- return this.type;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java
deleted file mode 100644
index 1b3f952590..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class BinaryXmlListAnnotation
- extends BinaryAnnotation
- implements XmlListAnnotation {
-
- public BinaryXmlListAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java
deleted file mode 100644
index a925f2d5b6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class BinaryXmlMimeTypeAnnotation
- extends BinaryAnnotation
- implements XmlMimeTypeAnnotation
-{
-
- private String value;
-
- public BinaryXmlMimeTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** XmlMimeTypeAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_MIME_TYPE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java
deleted file mode 100644
index 618d56348b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class BinaryXmlMixedAnnotation
- extends BinaryAnnotation
- implements XmlMixedAnnotation {
-
- public BinaryXmlMixedAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java
deleted file mode 100644
index 30c963fa17..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class BinaryXmlRegistryAnnotation
- extends BinaryAnnotation
- implements XmlRegistryAnnotation
-{
-
- public BinaryXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
deleted file mode 100644
index ac2e6159fd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class BinaryXmlRootElementAnnotation
- extends BinaryAnnotation
- implements XmlRootElementAnnotation
-{
- private String name;
- private String namespace;
-
-
- public BinaryXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlRootElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java
deleted file mode 100644
index ce0b09154e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class BinaryXmlSeeAlsoAnnotation
- extends BinaryAnnotation
- implements XmlSeeAlsoAnnotation {
-
- private final Vector<String> classes;
-
-
- public BinaryXmlSeeAlsoAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.classes = this.buildClasses();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateClasses();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classes);
- }
-
-
- // ********** XmlSeeAlsoAnnotation implementation **********
-
- // ***** value
- public ListIterable<String> getClasses() {
- return new LiveCloneListIterable<String>(this.classes);
- }
-
- public int getClassesSize() {
- return this.classes.size();
- }
-
- private Vector<String> buildClasses() {
- Object[] jdtClasses = this.getJdtMemberValues(JAXB.XML_SEE_ALSO__VALUE);
- Vector<String> result = new Vector<String>(jdtClasses.length);
- for (Object jdtClass : jdtClasses) {
- result.add((String) jdtClass);
- }
- return result;
- }
-
- public void addClass(String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void addClass(int index, String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeClass(String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void removeClass(int index) {
- throw new UnsupportedOperationException();
- }
-
- public ListIterable<String> getFullyQualifiedClasses() {
- return getClasses();
- }
-
- // TODO
- private void updateClasses() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java
deleted file mode 100644
index 57371ddb14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class BinaryXmlTransientAnnotation
- extends BinaryAnnotation
- implements XmlTransientAnnotation
-{
-
- public BinaryXmlTransientAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
deleted file mode 100644
index a2d08f7f2c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class BinaryXmlTypeAnnotation
- extends BinaryAnnotation
- implements XmlTypeAnnotation
-{
- private String factoryClass;
- private String factoryMethod;
- private String name;
- private String namespace;
- private final Vector<String> propOrder;
-
-
- public BinaryXmlTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.factoryClass = this.buildFactoryClass();
- this.factoryMethod = this.buildFactoryMethod();
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.propOrder = this.buildPropOrder();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setFactoryClass_(this.buildFactoryClass());
- this.setFactoryMethod_(this.buildFactoryMethod());
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factoryClass
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setFactoryClass_(String factoryClass) {
- String old = this.factoryClass;
- this.factoryClass = factoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, factoryClass);
- this.firePropertyChanged(FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY, old, factoryClass);
- }
-
- private String buildFactoryClass() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_CLASS);
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified factory class name
- public String getFullyQualifiedFactoryClassName() {
- return this.factoryClass;
- }
-
- // ***** factoryMethod
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- throw new UnsupportedOperationException();
- }
-
- private void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- private String buildFactoryMethod() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_METHOD);
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** prop order
- public ListIterable<String> getPropOrder() {
- return new LiveCloneListIterable<String>(this.propOrder);
- }
-
- public int getPropOrderSize() {
- return this.propOrder.size();
- }
-
- private Vector<String> buildPropOrder() {
- Object[] jdtPropOrder = this.getJdtMemberValues(JAXB.XML_TYPE__PROP_ORDER);
- Vector<String> result = new Vector<String>(jdtPropOrder.length);
- for (Object jdtProp : jdtPropOrder) {
- result.add((String) jdtProp);
- }
- return result;
- }
-
- public void addProp(String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void addProp(int index, String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(int index) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java
deleted file mode 100644
index d619f38f2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class BinaryXmlValueAnnotation
- extends BinaryAnnotation
- implements XmlValueAnnotation
-{
-
- public BinaryXmlValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java
deleted file mode 100644
index 5ae3119058..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class SourceXmlAccessorOrderAnnotation
- extends SourceAnnotation
- implements XmlAccessorOrderAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_ORDER);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private XmlAccessOrder value;
-
-
- public SourceXmlAccessorOrderAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(annotatedElement, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- //*************** XmlAccessorOrderAnnotation implementation ****************
-
- // ***** value
- public XmlAccessOrder getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessOrder value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(XmlAccessOrder.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(XmlAccessOrder astValue) {
- XmlAccessOrder old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private XmlAccessOrder buildValue(CompilationUnit astRoot) {
- return XmlAccessOrder.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- //remove the XmlAccessorOrder annotation when the value element is removed.
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ACCESSOR_ORDER__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 1c3b0bbd08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class SourceXmlAccessorTypeAnnotation
- extends SourceAnnotation
- implements XmlAccessorTypeAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private XmlAccessType value;
-
-
- public SourceXmlAccessorTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(annotatedElement, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- //*************** XmlAccessorTypeAnnotation implementation ****************
-
- // ***** value
- public XmlAccessType getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(XmlAccessType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(XmlAccessType astValue) {
- XmlAccessType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private XmlAccessType buildValue(CompilationUnit astRoot) {
- return XmlAccessType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- //remove the XmlAccessorType annotation when the value element is removed.
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ACCESSOR_TYPE__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java
deleted file mode 100644
index 0a70fa9786..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class SourceXmlAnyAttributeAnnotation
- extends SourceAnnotation
- implements XmlAnyAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ATTRIBUTE);
-
- public SourceXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
deleted file mode 100644
index 43e13bcd7d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class SourceXmlAnyElementAnnotation
- extends SourceAnnotation
- implements XmlAnyElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ELEMENT);
-
- private final DeclarationAnnotationElementAdapter<Boolean> laxDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> laxAdapter;
- private Boolean lax;
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private String fullyQualifiedValueClassName;
-
-
- // ********** constructors **********
- public SourceXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.laxDeclarationAdapter = this.buildLaxAdapter(daa);
- this.laxAdapter = this.buildShortCircuitBooleanElementAdapter(this.laxDeclarationAdapter);
- this.valueDeclarationAdapter = this.buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildLaxAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ANY_ELEMENT__LAX);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_ANY_ELEMENT__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.lax = this.buildLax(astRoot);
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncLax(this.buildLax(astRoot));
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlAnyElementAnnotation implementation **********
-
- // ***** lax
- public Boolean getLax() {
- return this.lax;
- }
-
- public void setLax(Boolean lax) {
- if (this.attributeValueHasChanged(this.lax, lax)) {
- this.lax = lax;
- this.laxAdapter.setValue(lax);
- }
- }
-
- private void syncLax(Boolean astLax) {
- Boolean old = this.lax;
- this.lax = astLax;
- this.firePropertyChanged(LAX_PROPERTY, old, astLax);
- }
-
- private Boolean buildLax(CompilationUnit astRoot) {
- return this.laxAdapter.getValue(astRoot);
- }
-
- public TextRange getLaxTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.laxDeclarationAdapter, astRoot);
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
- }
-
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java
deleted file mode 100644
index aeaddd91d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class SourceXmlAttachmentRefAnnotation
- extends SourceAnnotation
- implements XmlAttachmentRefAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTACHMENT_REF);
-
- public SourceXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
deleted file mode 100644
index 43d942ec92..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class SourceXmlAttributeAnnotation
- extends SourceAnnotation
- implements XmlAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTRIBUTE);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
-
- // ********** constructors **********
- public SourceXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ATTRIBUTE__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ATTRIBUTE__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ATTRIBUTE__REQUIRED);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.required = this.buildRequired(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlAttributeAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
deleted file mode 100644
index 5cb7f6007b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class SourceXmlElementAnnotation
- extends SourceAnnotation
- implements XmlElementAnnotation {
-
- private static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT);
-
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nillableAdapter;
- private Boolean nillable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
- private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedTypeName;
-
-
- public static SourceXmlElementAnnotation buildSourceXmlElementAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement) {
-
- return new SourceXmlElementAnnotation(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementAnnotation buildNestedSourceXmlElementAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceXmlElementAnnotation(parent, annotatedElement, idaa);
- }
-
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- }
-
- private SourceXmlElementAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa,
- AnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nillableDeclarationAdapter = this.buildNillableAdapter(daa);
- this.nillableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nillableDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- this.defaultValueDeclarationAdapter = this.buildDefaultValueAdapter(daa);
- this.defaultValueAdapter = this.buildAnnotationElementAdapter(this.defaultValueDeclarationAdapter);
- this.typeDeclarationAdapter = this.buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNillableAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT__NILLABLE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT__REQUIRED);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultValueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__DEFAULT_VALUE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_ELEMENT__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.nillable = this.buildNillable(astRoot);
- this.required = this.buildRequired(astRoot);
- this.defaultValue = this.buildDefaultValue(astRoot);
- this.type = this.buildType(astRoot);
- this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncNillable(this.buildNillable(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- this.syncDefaultValue(this.buildDefaultValue(astRoot));
- this.syncType(this.buildType(astRoot));
- this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- if (this.attributeValueHasChanged(this.nillable, nillable)) {
- this.nillable = nillable;
- this.nillableAdapter.setValue(nillable);
- }
- }
-
- private void syncNillable(Boolean astNillable) {
- Boolean old = this.nillable;
- this.nillable = astNillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, astNillable);
- }
-
- private Boolean buildNillable(CompilationUnit astRoot) {
- return this.nillableAdapter.getValue(astRoot);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-
- // ***** defaultValue
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (this.attributeValueHasChanged(this.defaultValue, defaultValue)) {
- this.defaultValue = defaultValue;
- this.defaultValueAdapter.setValue(defaultValue);
- }
- }
-
- private void syncDefaultValue(String astDefaultValue) {
- String old = this.defaultValue;
- this.defaultValue = astDefaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, astDefaultValue);
- }
-
- private String buildDefaultValue(CompilationUnit astRoot) {
- return this.defaultValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.fullyQualifiedTypeName;
- }
-
- private void syncFullyQualifiedTypeName(String name) {
- String old = this.fullyQualifiedTypeName;
- this.fullyQualifiedTypeName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTypeName(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
deleted file mode 100644
index 92745cb0f9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class SourceXmlElementDeclAnnotation
- extends SourceAnnotation
- implements XmlElementDeclAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_DECL);
-
- private final DeclarationAnnotationElementAdapter<String> scopeDeclarationAdapter;
- private final AnnotationElementAdapter<String> scopeAdapter;
- private String scope;
- private String fullyQualifiedScopeClassName;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> substitutionHeadNamespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> substitutionHeadNamespaceAdapter;
- private String substitutionHeadNamespace;
-
- private final DeclarationAnnotationElementAdapter<String> substitutionHeadNameDeclarationAdapter;
- private final AnnotationElementAdapter<String> substitutionHeadNameAdapter;
- private String substitutionHeadName;
-
- private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
-
- // ********** constructors **********
-
- public SourceXmlElementDeclAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- this.scopeDeclarationAdapter = buildScopeDeclarationAdapter();
- this.scopeAdapter = buildAnnotationElementAdapter(this.scopeDeclarationAdapter);
- this.namespaceDeclarationAdapter = buildNamespaceDeclarationAdapter();
- this.namespaceAdapter = buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nameDeclarationAdapter = buildNameDeclarationAdapter();
- this.nameAdapter = buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.substitutionHeadNamespaceDeclarationAdapter = buildSubstitutionHeadNamespaceDeclarationAdapter();
- this.substitutionHeadNamespaceAdapter = buildAnnotationElementAdapter(this.substitutionHeadNamespaceDeclarationAdapter);
- this.substitutionHeadNameDeclarationAdapter = buildSubstitutionHeadNameDeclarationAdapter();
- this.substitutionHeadNameAdapter = buildAnnotationElementAdapter(this.substitutionHeadNameDeclarationAdapter);
- this.defaultValueDeclarationAdapter = buildDefaultValueDeclarationAdapter();
- this.defaultValueAdapter = buildAnnotationElementAdapter(this.defaultValueDeclarationAdapter);
- }
-
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildScopeDeclarationAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SCOPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.scope = buildScope(astRoot);
- this.fullyQualifiedScopeClassName = buildFullyQualifiedScopeClassName(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.name = buildName(astRoot);
- this.substitutionHeadNamespace = buildSubstitutionHeadNamespace(astRoot);
- this.substitutionHeadName = buildSubstitutionHeadName(astRoot);
- this.defaultValue = buildDefaultValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncScope(buildScope(astRoot));
- syncFullyQualifiedScopeClassName(buildFullyQualifiedScopeClassName(astRoot));
- syncNamespace(buildNamespace(astRoot));
- syncName(buildName(astRoot));
- syncSubstitutionHeadNamespace(buildSubstitutionHeadNamespace(astRoot));
- syncSubstitutionHeadName(buildSubstitutionHeadName(astRoot));
- syncDefaultValue(buildDefaultValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- if (attributeValueHasChanged(this.scope, scope)) {
- this.scope = scope;
- this.scopeAdapter.setValue(scope);
- }
- }
-
- private void syncScope(String astScope) {
- String old = this.scope;
- this.scope = astScope;
- firePropertyChanged(SCOPE_PROPERTY, old, astScope);
- }
-
- private String buildScope(CompilationUnit astRoot) {
- return this.scopeAdapter.getValue(astRoot);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.scopeDeclarationAdapter, astRoot);
- }
-
-
- // ***** fully-qualified scope class name *****
-
- public String getFullyQualifiedScopeClassName() {
- return this.fullyQualifiedScopeClassName;
- }
-
- private void syncFullyQualifiedScopeClassName(String name) {
- String old = this.fullyQualifiedScopeClassName;
- this.fullyQualifiedScopeClassName = name;
- firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedScopeClassName(CompilationUnit astRoot) {
- return (this.scope == null) ? null : ASTTools.resolveFullyQualifiedName(this.scopeAdapter.getExpression(astRoot));
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** substitutionHeadNamespace *****
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- if (attributeValueHasChanged(this.substitutionHeadNamespace, substitutionHeadNamespace)) {
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- this.substitutionHeadNamespaceAdapter.setValue(substitutionHeadNamespace);
- }
- }
-
- private void syncSubstitutionHeadNamespace(String astSubstitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = astSubstitutionHeadNamespace;
- firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, astSubstitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace(CompilationUnit astRoot) {
- return this.substitutionHeadNamespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNamespaceDeclarationAdapter, astRoot);
- }
-
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNamespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** substitutionHeadName *****
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- if (attributeValueHasChanged(this.substitutionHeadName, substitutionHeadName)) {
- this.substitutionHeadName = substitutionHeadName;
- this.substitutionHeadNameAdapter.setValue(substitutionHeadName);
- }
- }
-
- private void syncSubstitutionHeadName(String astSubstitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = astSubstitutionHeadName;
- firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, astSubstitutionHeadName);
- }
-
- private String buildSubstitutionHeadName(CompilationUnit astRoot) {
- return this.substitutionHeadNameAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNameDeclarationAdapter, astRoot);
- }
-
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** defaultValue *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (attributeValueHasChanged(this.defaultValue, defaultValue)) {
- this.defaultValue = defaultValue;
- this.defaultValueAdapter.setValue(defaultValue);
- }
- }
-
- private void syncDefaultValue(String astDefaultValue) {
- String old = this.defaultValue;
- this.defaultValue = astDefaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, astDefaultValue);
- }
-
- private String buildDefaultValue(CompilationUnit astRoot) {
- return this.defaultValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
deleted file mode 100644
index ac108d4d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class SourceXmlElementRefAnnotation
- extends SourceAnnotation
- implements XmlElementRefAnnotation {
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REF);
-
-
- private String fullyQualifiedTypeName;
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
-
-
- public static SourceXmlElementRefAnnotation buildSourceXmlElementRefAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement) {
-
- return new SourceXmlElementRefAnnotation(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementRefAnnotation buildNestedSourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceXmlElementRefAnnotation(parent, annotatedElement, idaa);
- }
-
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa) {
-
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- this(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa,
- AnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceDeclarationAdapter();
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- this.typeDeclarationAdapter = this.buildTypeDeclarationAdapter();
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JAXB.XML_ELEMENT_REF__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_REF__REQUIRED);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeDeclarationAdapter() {
- return buildAnnotationElementAdapter(this.daa, JAXB.XML_ELEMENT_REF__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.required = this.buildRequired(astRoot);
- this.type = this.buildType(astRoot);
- this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- this.syncType(this.buildType(astRoot));
- this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementRefAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.fullyQualifiedTypeName;
- }
-
- private void syncFullyQualifiedTypeName(String name) {
- String old = this.fullyQualifiedTypeName;
- this.fullyQualifiedTypeName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTypeName(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java
deleted file mode 100644
index d17b57fb22..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRefs
- */
-public class SourceXmlElementRefsAnnotation
- extends SourceAnnotation
- implements XmlElementRefsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REFS);
-
-
- private final XmlElementRefsAnnotationContainer xmlElementRefsContainer
- = new XmlElementRefsAnnotationContainer();
-
-
- public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementRefsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.xmlElementRefsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
-
- // **************** xml element refs **************************************
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() {
- return this.xmlElementRefsContainer.getNestedAnnotations();
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefsContainer.getNestedAnnotationsSize();
- }
-
- public XmlElementRefAnnotation xmlElementRefAt(int index) {
- return this.xmlElementRefsContainer.getNestedAnnotation(index);
- }
-
- public XmlElementRefAnnotation addXmlElementRef(int index) {
- return this.xmlElementRefsContainer.addNestedAnnotation(index);
- }
-
- private XmlElementRefAnnotation buildXmlElementRef(int index) {
- return SourceXmlElementRefAnnotation.buildNestedSourceXmlElementRefAnnotation(
- this, this.annotatedElement, buildXmlElementRefIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlElementRefIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_ELEMENT_REFS__VALUE, index, JAXB.XML_ELEMENT_REF);
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- this.xmlElementRefsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlElementRef(int index) {
- this.xmlElementRefsContainer.removeNestedAnnotation(index);
- }
-
-
- class XmlElementRefsAnnotationContainer
- extends AnnotationContainer<XmlElementRefAnnotation> {
-
- @Override
- protected String getNestedAnnotationsListName() {
- return XML_ELEMENT_REFS_LIST;
- }
-
- @Override
- protected String getElementName() {
- return JAXB.XML_ELEMENT_REFS__VALUE;
- }
-
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- protected XmlElementRefAnnotation buildNestedAnnotation(int index) {
- return SourceXmlElementRefsAnnotation.this.buildXmlElementRef(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
deleted file mode 100644
index 8f02178031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class SourceXmlElementWrapperAnnotation
- extends SourceAnnotation
- implements XmlElementWrapperAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_WRAPPER);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nillableAdapter;
- private Boolean nillable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
-
- // ********** constructors **********
- public SourceXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nillableDeclarationAdapter = this.buildNillableAdapter(daa);
- this.nillableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nillableDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_WRAPPER__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNillableAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.nillable = this.buildNillable(astRoot);
- this.required = this.buildRequired(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncNillable(this.buildNillable(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementWrapperAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- if (this.attributeValueHasChanged(this.nillable, nillable)) {
- this.nillable = nillable;
- this.nillableAdapter.setValue(nillable);
- }
- }
-
- private void syncNillable(Boolean astNillable) {
- Boolean old = this.nillable;
- this.nillable = astNillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, astNillable);
- }
-
- private Boolean buildNillable(CompilationUnit astRoot) {
- return this.nillableAdapter.getValue(astRoot);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java
deleted file mode 100644
index aa20592bf7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElements
- */
-public class SourceXmlElementsAnnotation
- extends SourceAnnotation
- implements XmlElementsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENTS);
-
-
- private final XmlElementsAnnotationContainer xmlElementsContainer = new XmlElementsAnnotationContainer();
-
- public SourceXmlElementsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.xmlElementsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
-
- // **************** xmlns *************************************************
-
- public ListIterable<XmlElementAnnotation> getXmlElements() {
- return this.xmlElementsContainer.getNestedAnnotations();
- }
-
- public int getXmlElementsSize() {
- return this.xmlElementsContainer.getNestedAnnotationsSize();
- }
-
- public XmlElementAnnotation xmlElementAt(int index) {
- return this.xmlElementsContainer.getNestedAnnotation(index);
- }
-
- public XmlElementAnnotation addXmlElement(int index) {
- return this.xmlElementsContainer.addNestedAnnotation(index);
- }
-
- private XmlElementAnnotation buildXmlElement(int index) {
- return SourceXmlElementAnnotation.buildNestedSourceXmlElementAnnotation(this, this.annotatedElement, buildXmlElementIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlElementIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_ELEMENTS__VALUE, index, JAXB.XML_ELEMENT);
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- this.xmlElementsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlElement(int index) {
- this.xmlElementsContainer.removeNestedAnnotation(index);
- }
-
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class XmlElementsAnnotationContainer
- extends AnnotationContainer<XmlElementAnnotation>
- {
- @Override
- protected String getNestedAnnotationsListName() {
- return XML_ELEMENTS_LIST;
- }
- @Override
- protected String getElementName() {
- return JAXB.XML_ELEMENTS__VALUE;
- }
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
- @Override
- protected XmlElementAnnotation buildNestedAnnotation(int index) {
- return SourceXmlElementsAnnotation.this.buildXmlElement(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
deleted file mode 100644
index f2dcbaf5d5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class SourceXmlEnumAnnotation
- extends SourceAnnotation
- implements XmlEnumAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- private String fullyQualifiedValueClassName;
-
- public SourceXmlEnumAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
- }
-
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ENUM__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
deleted file mode 100644
index f7b4421461..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class SourceXmlEnumValueAnnotation
- extends SourceAnnotation
- implements XmlEnumValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlEnumValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(VALUE_ADAPTER, pos, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ENUM_VALUE__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java
deleted file mode 100644
index dd54b7d5bc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class SourceXmlIDAnnotation
- extends SourceAnnotation
- implements XmlIDAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ID);
-
- public SourceXmlIDAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java
deleted file mode 100644
index e2632aab22..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class SourceXmlIDREFAnnotation
- extends SourceAnnotation
- implements XmlIDREFAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_IDREF);
-
- public SourceXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index 0c9f6b99ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class SourceXmlInlineBinaryDataAnnotation
- extends SourceAnnotation
- implements XmlInlineBinaryDataAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_INLINE_BINARY_DATA);
-
-
- public SourceXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 8a723c6430..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class SourceXmlJavaTypeAdapterAnnotation
- extends SourceAnnotation
- implements XmlJavaTypeAdapterAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTER);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTERS);
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private String fullyQualifiedValue;
-
- /*
- * We want this event fired when the fq class changes by itself, not as a result
- * of the non-fq class changing.
- */
- private boolean suppressFQValueEventNotification = false;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
- /*
- * We want this event fired when the fq class changes by itself, not as a result
- * of the non-fq class changing.
- */
- private boolean suppressFQTypeEventNotification = false;
-
-
- // ********** constructors **********
- public static SourceXmlJavaTypeAdapterAnnotation buildSourceXmlJavaTypeAdapterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildXmlJavaTypeAdapterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlJavaTypeAdapterAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlJavaTypeAdapterAnnotation(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
- private SourceXmlJavaTypeAdapterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.valueDeclarationAdapter = buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- this.typeDeclarationAdapter = buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = buildValue(astRoot);
- this.fullyQualifiedValue = buildFullyQualifiedValue(astRoot);
- this.type = buildType(astRoot);
- this.fullyQualifiedType = buildFullyQualifiedType(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncValue(buildValue(astRoot));
- syncType(buildType(astRoot));
- syncFullyQualifiedValue(buildFullyQualifiedValue(astRoot));
- syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
-
- this.suppressFQValueEventNotification = false;
- this.suppressFQTypeEventNotification = false;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlJavaTypeAdapterAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.suppressFQValueEventNotification = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.suppressFQValueEventNotification |= StringTools.stringsAreEqual(old, astValue);
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedValue() {
- return this.fullyQualifiedValue;
- }
-
- private void syncFullyQualifiedValue(String name) {
- String old = this.fullyQualifiedValue;
- this.fullyQualifiedValue = name;
- if (! this.suppressFQValueEventNotification) {
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, name);
- }
- }
-
- private String buildFullyQualifiedValue(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.suppressFQTypeEventNotification = true;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.suppressFQTypeEventNotification |= StringTools.stringsAreEqual(old, astType);
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedType() {
- return this.fullyQualifiedType;
- }
-
- private void syncFullyQualifiedType(String name) {
- String old = this.fullyQualifiedType;
- this.fullyQualifiedType = name;
- if (! this.suppressFQTypeEventNotification) {
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
- }
- }
-
- private String buildFullyQualifiedType(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlJavaTypeAdapterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlJavaTypeAdapterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_JAVA_TYPE_ADAPTER);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java
deleted file mode 100644
index db44733f1d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class SourceXmlListAnnotation
- extends SourceAnnotation
- implements XmlListAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_LIST);
-
- public SourceXmlListAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
deleted file mode 100644
index 5bcdba75b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class SourceXmlMimeTypeAnnotation
- extends SourceAnnotation
- implements XmlMimeTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIME_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlMimeTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlMimeTypeAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_MIME_TYPE__VALUE);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java
deleted file mode 100644
index 9d469b2db2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class SourceXmlMixedAnnotation
- extends SourceAnnotation
- implements XmlMixedAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIXED);
-
- public SourceXmlMixedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
deleted file mode 100644
index 890f2fb793..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-
-public class SourceXmlNsAnnotation
- extends SourceAnnotation
- implements XmlNsAnnotation {
-
- private final DeclarationAnnotationElementAdapter<String> namespaceURIDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceURIAdapter;
- private String namespaceURI;
-
- private final DeclarationAnnotationElementAdapter<String> prefixDeclarationAdapter;
- private final AnnotationElementAdapter<String> prefixAdapter;
- private String prefix;
-
-
- public SourceXmlNsAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- this.namespaceURIDeclarationAdapter = this.buildNamespaceURIDeclarationAdapter(idaa);
- this.namespaceURIAdapter = this.buildAdapter(this.namespaceURIDeclarationAdapter);
- this.prefixDeclarationAdapter = this.buildPrefixDeclarationAdapter(idaa);
- this.prefixAdapter = buildAdapter(this.prefixDeclarationAdapter);
- }
-
-
- protected DeclarationAnnotationElementAdapter<String> buildNamespaceURIDeclarationAdapter(
- DeclarationAnnotationAdapter daa) {
-
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_NS__NAMESPACE_URI);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildPrefixDeclarationAdapter(
- DeclarationAnnotationAdapter daa) {
-
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_NS__PREFIX);
- }
-
- private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_NS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.namespaceURI = buildNamespaceURI(astRoot);
- this.prefix = buildPrefix(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncNamespaceURI(buildNamespaceURI(astRoot));
- syncPrefix(buildPrefix(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namespaceURI);
- }
-
-
- // ***** namespace *****
-
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- public void setNamespaceURI(String namespaceURI) {
- if (attributeValueHasChanged(this.namespaceURI, namespaceURI)) {
- this.namespaceURI = namespaceURI;
- this.namespaceURIAdapter.setValue(namespaceURI);
- }
- }
-
- private String buildNamespaceURI(CompilationUnit astRoot) {
- return this.namespaceURIAdapter.getValue(astRoot);
- }
-
- private void syncNamespaceURI(String namespaceURI) {
- String old = this.namespaceURI;
- this.namespaceURI = namespaceURI;
- firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
- }
-
- public TextRange getNamespaceURITextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.namespaceURIDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceURITouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceURIDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** prefix *****
-
- public String getPrefix() {
- return this.prefix;
- }
-
- public void setPrefix(String prefix) {
- if (attributeValueHasChanged(this.prefix, prefix)) {
- this.prefix = prefix;
- this.prefixAdapter.setValue(prefix);
- }
- }
-
- private String buildPrefix(CompilationUnit astRoot) {
- return this.prefixAdapter.getValue(astRoot);
- }
-
- private void syncPrefix(String prefix) {
- String old = this.prefix;
- this.prefix = prefix;
- firePropertyChanged(PREFIX_PROPERTY, old, prefix);
- }
-
- public TextRange getPrefixTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.prefixDeclarationAdapter, astRoot);
- }
-
- public boolean prefixTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.prefixDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** NestableAnnotation impl *****
-
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java
deleted file mode 100644
index a450bba3ec..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class SourceXmlRegistryAnnotation
- extends SourceAnnotation
- implements XmlRegistryAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_REGISTRY);
-
- public SourceXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
deleted file mode 100644
index c6dd697b8c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class SourceXmlRootElementAnnotation
- extends SourceAnnotation
- implements XmlRootElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ROOT_ELEMENT);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- public SourceXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlRootElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ROOT_ELEMENT__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ROOT_ELEMENT__NAMESPACE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
deleted file mode 100644
index 592bd9c78c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-
-public class SourceXmlSchemaAnnotation
- extends SourceAnnotation
- implements XmlSchemaAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> ATTRIBUTE_FORM_DEFAULT_ADAPTER =
- buildAttributeFormDefaultAdapter();
- private final AnnotationElementAdapter<String> attributeFormDefaultAdapter;
- private XmlNsForm attributeFormDefault;
-
- private static final DeclarationAnnotationElementAdapter<String> ELEMENT_FORM_DEFAULT_ADAPTER =
- buildElementFormDefaultAdapter();
- private final AnnotationElementAdapter<String> elementFormDefaultAdapter;
- private XmlNsForm elementFormDefault;
-
- private static final DeclarationAnnotationElementAdapter<String> LOCATION_ADAPTER =
- buildLocationAdapter();
- private final AnnotationElementAdapter<String> locationAdapter;
- private String location;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER =
- buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final XmlnsAnnotationContainer xmlnsContainer = new XmlnsAnnotationContainer();
-
-
- private static DeclarationAnnotationElementAdapter<String> buildAttributeFormDefaultAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT); //remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildElementFormDefaultAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT); // remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildLocationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__LOCATION); // remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__NAMESPACE); // remove annotation when empty
- }
-
-
- public SourceXmlSchemaAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlSchemaAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- this.attributeFormDefaultAdapter = buildAnnotationElementAdapter(ATTRIBUTE_FORM_DEFAULT_ADAPTER);
- this.elementFormDefaultAdapter = buildAnnotationElementAdapter(ELEMENT_FORM_DEFAULT_ADAPTER);
- this.locationAdapter = buildAnnotationElementAdapter(LOCATION_ADAPTER);
- this.namespaceAdapter = buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- }
-
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.attributeFormDefault = buildAttributeFormDefault(astRoot);
- this.elementFormDefault = buildElementFormDefault(astRoot);
- this.location = buildLocation(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.xmlnsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncAttributeFormDefault(buildAttributeFormDefault(astRoot));
- syncElementFormDefault(buildElementFormDefault(astRoot));
- syncLocation(buildLocation(astRoot));
- syncNamespace(buildNamespace(astRoot));
- this.xmlnsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namespace);
- }
-
-
- // **************** attribute form default ********************************
-
- public XmlNsForm getAttributeFormDefault() {
- return this.attributeFormDefault;
- }
-
- public void setAttributeFormDefault(XmlNsForm attributeFormDefault) {
- if (attributeValueHasChanged(this.attributeFormDefault, attributeFormDefault)) {
- this.attributeFormDefault = attributeFormDefault;
- this.attributeFormDefaultAdapter.setValue(XmlNsForm.toJavaAnnotationValue(attributeFormDefault));
- }
- }
-
- private XmlNsForm buildAttributeFormDefault(CompilationUnit astRoot) {
- return XmlNsForm.fromJavaAnnotationValue(this.attributeFormDefaultAdapter.getValue(astRoot));
- }
-
- private void syncAttributeFormDefault(XmlNsForm attributeFormDefault) {
- XmlNsForm old = this.attributeFormDefault;
- this.attributeFormDefault = attributeFormDefault;
- firePropertyChanged(ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
- }
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ATTRIBUTE_FORM_DEFAULT_ADAPTER, astRoot);
- }
-
-
- // **************** element form default ********************************
-
- public XmlNsForm getElementFormDefault() {
- return this.elementFormDefault;
- }
-
- public void setElementFormDefault(XmlNsForm elementFormDefault) {
- if (attributeValueHasChanged(this.elementFormDefault, elementFormDefault)) {
- this.elementFormDefault = elementFormDefault;
- this.elementFormDefaultAdapter.setValue(XmlNsForm.toJavaAnnotationValue(elementFormDefault));
- }
- }
-
- private XmlNsForm buildElementFormDefault(CompilationUnit astRoot) {
- return XmlNsForm.fromJavaAnnotationValue(this.elementFormDefaultAdapter.getValue(astRoot));
- }
-
- private void syncElementFormDefault(XmlNsForm elementFormDefault) {
- XmlNsForm old = this.elementFormDefault;
- this.elementFormDefault = elementFormDefault;
- firePropertyChanged(ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
- }
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ELEMENT_FORM_DEFAULT_ADAPTER, astRoot);
- }
-
-
- // **************** location **********************************************
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- if (attributeValueHasChanged(this.location, location)) {
- this.location = location;
- this.locationAdapter.setValue(location);
- }
- }
-
- private String buildLocation(CompilationUnit astRoot) {
- return this.locationAdapter.getValue(astRoot);
- }
-
- private void syncLocation(String location) {
- String old = this.location;
- this.location = location;
- firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(LOCATION_ADAPTER, astRoot);
- }
-
-
- // **************** namespace *********************************************
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- private void syncNamespace(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- // **************** xmlns *************************************************
-
- public ListIterable<XmlNsAnnotation> getXmlns() {
- return this.xmlnsContainer.getNestedAnnotations();
- }
-
- public int getXmlnsSize() {
- return this.xmlnsContainer.getNestedAnnotationsSize();
- }
-
- public XmlNsAnnotation xmlnsAt(int index) {
- return this.xmlnsContainer.getNestedAnnotation(index);
- }
-
- public XmlNsAnnotation addXmlns(int index) {
- return this.xmlnsContainer.addNestedAnnotation(index);
- }
-
- private XmlNsAnnotation buildXmlns(int index) {
- return new SourceXmlNsAnnotation(
- this, this.annotatedElement, buildXmlnsIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlnsIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_SCHEMA__XMLNS, index, JAXB.XML_NS);
- }
-
- public void moveXmlns(int targetIndex, int sourceIndex) {
- this.xmlnsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlns(int index) {
- this.xmlnsContainer.removeNestedAnnotation(index);
- }
-
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class XmlnsAnnotationContainer
- extends AnnotationContainer<XmlNsAnnotation>
- {
- @Override
- protected String getNestedAnnotationsListName() {
- return XMLNS_LIST;
- }
- @Override
- protected String getElementName() {
- return JAXB.XML_SCHEMA__XMLNS;
- }
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_NS;
- }
- @Override
- protected XmlNsAnnotation buildNestedAnnotation(int index) {
- return SourceXmlSchemaAnnotation.this.buildXmlns(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
deleted file mode 100644
index 9ad6a7c39a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchemaType
- */
-public class SourceXmlSchemaTypeAnnotation
- extends SourceAnnotation
- implements XmlSchemaTypeAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPE);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPES);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
-
- // ********** constructors **********
-
- public static SourceXmlSchemaTypeAnnotation buildSourceXmlSchemaTypeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- int index) {
-
- IndexedDeclarationAnnotationAdapter idaa = buildXmlSchemaTypeDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlSchemaTypeAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlSchemaTypeAnnotation(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
- private SourceXmlSchemaTypeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.typeDeclarationAdapter = buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_SCHEMA_TYPE__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_SCHEMA_TYPE__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_SCHEMA_TYPE__TYPE,
- SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName,
- ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(
- annotationAdapter, elementName, converter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = buildName(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.type = buildType(astRoot);
- this.fullyQualifiedType = buildFullyQualifiedType(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncName(buildName(astRoot));
- syncNamespace(buildNamespace(astRoot));
- syncType(buildType(astRoot));
- syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // **************** XmlSchemaTypeAnnotation impl **************************
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedType() {
- return this.fullyQualifiedType;
- }
-
- private void syncFullyQualifiedType(String name) {
- String old = this.fullyQualifiedType;
- this.fullyQualifiedType = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedType(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlSchemaTypeAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlSchemaTypeDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_SCHEMA_TYPE);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
deleted file mode 100644
index 348e508f5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class SourceXmlSeeAlsoAnnotation
- extends SourceAnnotation
- implements XmlSeeAlsoAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SEE_ALSO);
-
- private final DeclarationAnnotationElementAdapter<String[]> valueDeclarationAdapter;
-
- private final AnnotationElementAdapter<String[]> valueAdapter;
-
- private final Vector<String> classes;
-
- /*
- * We want this event fired when the fq classes change by themselves, not as a result
- * of the value changing.
- */
- private boolean suppressFQClassesEventNotification = false;
-
- private final Vector<String> fullyQualifiedClasses;
-
-
- public SourceXmlSeeAlsoAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SEE_ALSO__VALUE);
- this.valueAdapter = this.buildArrayAnnotationElementAdapter(this.valueDeclarationAdapter);
- this.classes = new Vector<String>();
- this.fullyQualifiedClasses = new Vector<String>();
- }
-
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- public void initialize(CompilationUnit astRoot) {
- for (String astClass : this.valueAdapter.getValue(astRoot)) {
- this.classes.add(astClass);
- }
- CollectionTools.addAll(this.fullyQualifiedClasses, buildFullyQualifiedClasses(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- String[] astClasses = this.valueAdapter.getValue(astRoot);
- synchronizeList(Arrays.asList(astClasses), this.classes, CLASSES_LIST);
-
- if (this.suppressFQClassesEventNotification) {
- this.fullyQualifiedClasses.clear();
- CollectionTools.addAll(this.fullyQualifiedClasses, buildFullyQualifiedClasses(astRoot));
- this.suppressFQClassesEventNotification = false;
- }
- else {
- synchronizeList(buildFullyQualifiedClasses(astRoot), this.fullyQualifiedClasses, FULLY_QUALIFIED_CLASSES_LIST);
- }
- }
-
- protected Iterable<String> buildFullyQualifiedClasses(final CompilationUnit astRoot) {
- Expression expression = this.valueAdapter.getExpression(astRoot);
- if (expression == null) {
- return EmptyIterable.<String>instance();
- }
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- return new SingleElementIterable<String>(ASTTools.resolveFullyQualifiedName(expression));
- }
- else {
- return ASTTools.resolveFullyQualifiedNames(expression);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classes);
- }
-
-
- // ********** XmlSeeAlsoAnnotation implementation **********
-
- // ***** classes
- public ListIterable<String> getClasses() {
- return new LiveCloneListIterable<String>(this.classes);
- }
-
- public int getClassesSize() {
- return this.classes.size();
- }
-
- public void addClass(String clazz) {
- this.addClass(this.classes.size(), clazz);
- }
-
- public void addClass(int index, String clazz) {
- this.classes.add(index, clazz);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.classes, targetIndex, sourceIndex);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public void removeClass(int index) {
- this.classes.remove(index);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public ListIterable<String> getFullyQualifiedClasses() {
- return new LiveCloneListIterable<String>(this.fullyQualifiedClasses);
- }
-
- private void writeClasses() {
- this.valueAdapter.setValue(this.classes.toArray(new String[this.classes.size()]));
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forTypes());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, converter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java
deleted file mode 100644
index dc17b833e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class SourceXmlTransientAnnotation
- extends SourceAnnotation
- implements XmlTransientAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TRANSIENT);
-
- public SourceXmlTransientAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
deleted file mode 100644
index 5f03152908..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.IndexedConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class SourceXmlTypeAnnotation
- extends SourceAnnotation
- implements XmlTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> FACTORY_CLASS_ADAPTER = buildFactoryClassAdapter();
- private final AnnotationElementAdapter<String> factoryClassAdapter;
- private String factoryClass;
-
- private String fullyQualifiedFactoryClassName;
-
- private static final DeclarationAnnotationElementAdapter<String> FACTORY_METHOD_ADAPTER = buildFactoryMethodAdapter();
- private final AnnotationElementAdapter<String> factoryMethodAdapter;
- private String factoryMethod;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final IndexedDeclarationAnnotationElementAdapter<String> propOrderDeclarationAdapter;
- private final AnnotationElementAdapter<String[]> propOrderAdapter;
- private final Vector<String> propOrder = new Vector<String>();
-
- public SourceXmlTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.factoryClassAdapter = this.buildAnnotationElementAdapter(FACTORY_CLASS_ADAPTER);
- this.factoryMethodAdapter = this.buildAnnotationElementAdapter(FACTORY_METHOD_ADAPTER);
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- this.propOrderDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__PROP_ORDER);
- this.propOrderAdapter = this.buildArrayAnnotationElementAdapter(this.propOrderDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private static IndexedDeclarationAnnotationElementAdapter<String> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static IndexedDeclarationAnnotationElementAdapter<String> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, IndexedExpressionConverter<String> converter) {
- return new IndexedConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.factoryClass = this.buildFactoryClass(astRoot);
- this.fullyQualifiedFactoryClassName = this.buildFullyQualifiedFactoryClassName(astRoot);
- this.factoryMethod = this.buildFactoryMethod(astRoot);
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.initializePropOrder(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFactoryClass(this.buildFactoryClass(astRoot));
- this.syncFullyQualifiedFactoryClassName(this.buildFullyQualifiedFactoryClassName(astRoot));
- this.syncFactoryMethod(this.buildFactoryMethod(astRoot));
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncPropOrder(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factoryClass
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- if (this.attributeValueHasChanged(this.factoryClass, factoryClass)) {
- this.factoryClass = factoryClass;
- this.factoryClassAdapter.setValue(factoryClass);
- }
- }
-
- private void syncFactoryClass(String astFactoryClass) {
- String old = this.factoryClass;
- this.factoryClass = astFactoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, astFactoryClass);
- }
-
- private String buildFactoryClass(CompilationUnit astRoot) {
- return this.factoryClassAdapter.getValue(astRoot);
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_CLASS_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified factory class name
- public String getFullyQualifiedFactoryClassName() {
- return this.fullyQualifiedFactoryClassName;
- }
-
- private void syncFullyQualifiedFactoryClassName(String name) {
- String old = this.fullyQualifiedFactoryClassName;
- this.fullyQualifiedFactoryClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedFactoryClassName(CompilationUnit astRoot) {
- return (this.factoryClass == null) ? null : ASTTools.resolveFullyQualifiedName(this.factoryClassAdapter.getExpression(astRoot));
- }
-
- // ***** factoryMethod
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- if (this.attributeValueHasChanged(this.factoryMethod, factoryMethod)) {
- this.factoryMethod = factoryMethod;
- this.factoryMethodAdapter.setValue(factoryMethod);
- }
- }
-
- private void syncFactoryMethod(String astFactoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = astFactoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, astFactoryMethod);
- }
-
- private String buildFactoryMethod(CompilationUnit astRoot) {
- return this.factoryMethodAdapter.getValue(astRoot);
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_METHOD_ADAPTER, astRoot);
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- // ***** prop order *****
-
- public ListIterable<String> getPropOrder() {
- return new LiveCloneListIterable<String>(this.propOrder);
- }
-
- public int getPropOrderSize() {
- return this.propOrder.size();
- }
-
- public void addProp(String prop) {
- this.addProp(this.propOrder.size(), prop);
- }
-
- public void addProp(int index, String prop) {
- this.propOrder.add(index, prop);
- this.writePropOrder();
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.propOrder, targetIndex, sourceIndex);
- this.writePropOrder();
- }
-
- public void removeProp(String prop) {
- this.propOrder.remove(prop);
- this.writePropOrder();
- }
-
- public void removeProp(int index) {
- this.propOrder.remove(index);
- this.writePropOrder();
- }
-
- private void writePropOrder() {
- this.propOrderAdapter.setValue(this.propOrder.toArray(new String[this.propOrder.size()]));
- }
-
- private void initializePropOrder(CompilationUnit astRoot) {
- String[] astPropOrder = this.propOrderAdapter.getValue(astRoot);
- for (int i = 0; i < astPropOrder.length; i++) {
- this.propOrder.add(astPropOrder[i]);
- }
- }
-
- private void syncPropOrder(CompilationUnit astRoot) {
- String[] astPropOrder = this.propOrderAdapter.getValue(astRoot);
- this.synchronizeList(Arrays.asList(astPropOrder), this.propOrder, PROP_ORDER_LIST);
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.propOrderDeclarationAdapter, astRoot);
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.propOrderDeclarationAdapter, pos, astRoot);
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getElementTextRange(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, index, astRoot), astRoot);
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return textRangeTouches(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, index, astRoot), pos);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildFactoryClassAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__FACTORY_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFactoryMethodAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__FACTORY_METHOD);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__NAMESPACE);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java
deleted file mode 100644
index a6f5d45501..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class SourceXmlValueAnnotation
- extends SourceAnnotation
- implements XmlValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_VALUE);
-
- public SourceXmlValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
deleted file mode 100644
index 4e17fb10e4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.resource.AbstractJaxbFileResourceModel;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-/**
- * JAXB index
- */
-public class JaxbIndexResourceImpl
- extends AbstractJaxbFileResourceModel<Vector<String>>
- implements JaxbIndexResource
-{
- public JaxbIndexResourceImpl(IFile file) {
- super(file);
- }
-
- @Override
- protected Vector<String> buildState() {
- return new Vector<String>();
- }
-
- @Override
- protected void reload() {
- this.state.clear();
- super.reload();
- }
-
- @Override
- protected void load(InputStream stream) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
- String line = reader.readLine();
- while (line != null) {
- this.state.add(line.trim());
- line = reader.readLine();
- }
- }
-
- public Iterable<String> getFullyQualifiedClassNames() {
- return (this.packageName == null) ?
- this.getSimpleClassNames() :
- this.getPrefixedClassNames();
- }
-
- protected Iterable<String> getSimpleClassNames() {
- return new SnapshotCloneIterable<String>(this.state);
- }
-
- protected Iterable<String> getPrefixedClassNames() {
- return new TransformationIterable<String, String>(
- this.getSimpleClassNames(),
- new PrefixTransformer(this.packageName + '.')
- );
- }
-
- protected class PrefixTransformer
- implements Transformer<String, String>
- {
- protected final String prefix;
- protected PrefixTransformer(String prefix) {
- super();
- this.prefix = prefix;
- }
- public String transform(String string) {
- return this.prefix + string;
- }
- }
-
- public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_INDEX_RESOURCE_TYPE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
deleted file mode 100644
index f1600741da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-
-public class JaxbIndexResourceModelProvider
- implements JaxbResourceModelProvider {
-
- // singleton
- private static final JaxbIndexResourceModelProvider INSTANCE = new JaxbIndexResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbIndexResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- private final Map<IFile, JaxbIndexResourceImpl> models = new HashMap<IFile, JaxbIndexResourceImpl>();
-
- private final IResourceChangeListener resourceChangeListener;
-
-
- /**
- * Enforce singleton usage
- */
- private JaxbIndexResourceModelProvider() {
- super();
- this.resourceChangeListener = buildResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- }
-
-
- protected IResourceChangeListener buildResourceChangeListener() {
- return new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- handleResourceChangeEvent(event);
- }
- };
- }
-
- public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE;
- }
-
- public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return buildResourceModel(file);
- }
-
- public JaxbIndexResource buildResourceModel(IFile file) {
- JaxbIndexResourceImpl resource = this.models.get(file);
- if (resource != null) {
- return resource;
- }
- resource = new JaxbIndexResourceImpl(file);
- this.models.put(file, resource);
- return resource;
- }
-
- protected void handleResourceChangeEvent(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE :
- removeProjectResources((IProject) event.getResource());
- return;
-
- case IResourceChangeEvent.POST_CHANGE :
- updateResources(event.getDelta());
- }
- }
-
- protected void removeProjectResources(IProject removedProject) {
- for (IFile file : new SnapshotCloneIterable<IFile>(this.models.keySet())) {
- if (file.getProject().equals(removedProject)) {
- removeResource(file);
- }
- }
- }
-
- protected void updateResources(IResourceDelta delta) {
- try {
- delta.accept(new ResourceDeltaVisitor());
- }
- catch (CoreException ce) {
- // shouldn't happen
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void removeResource(IFile file) {
- this.models.remove(file);
- }
-
- protected void updateResource(IFile file) {
- JaxbIndexResourceImpl resource = this.models.get(file);
- if (resource != null) {
- resource.update();
- }
- }
-
-
- protected class ResourceDeltaVisitor
- implements IResourceDeltaVisitor {
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (deltaKind == IResourceDelta.REMOVED) {
- JaxbIndexResourceModelProvider.this.removeResource(file);
- }
- else if (deltaKind == IResourceDelta.CHANGED) {
- JaxbIndexResourceModelProvider.this.updateResource(file);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
deleted file mode 100644
index be6842c4aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.resource.AbstractJaxbFileResourceModel;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-/**
- * JAXB index
- */
-public class JaxbPropertiesResourceImpl
- extends AbstractJaxbFileResourceModel<Properties>
- implements JaxbPropertiesResource
-{
- public JaxbPropertiesResourceImpl(IFile file) {
- super(file);
- }
-
- @Override
- protected Properties buildState() {
- return new Properties();
- }
-
- @Override
- protected void reload() {
- this.state.clear();
- super.reload();
- }
-
- @Override
- protected void load(InputStream stream) throws IOException {
- this.state.load(stream);
- }
-
- public String getProperty(String propertyName) {
- return this.state.getProperty(propertyName);
- }
-
- public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_RESOURCE_TYPE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
deleted file mode 100644
index d2b2e72c72..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPropertiesResourceModelProvider
- implements JaxbResourceModelProvider {
-
- // singleton
- private static final JaxbPropertiesResourceModelProvider INSTANCE = new JaxbPropertiesResourceModelProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPropertiesResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- private final Map<IFile, JaxbPropertiesResourceImpl> models = new HashMap<IFile, JaxbPropertiesResourceImpl>();
-
- private final IResourceChangeListener resourceChangeListener;
-
-
- /**
- * Enforce singleton usage
- */
- private JaxbPropertiesResourceModelProvider() {
- super();
- this.resourceChangeListener = buildResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- }
-
-
- protected IResourceChangeListener buildResourceChangeListener() {
- return new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- handleResourceChangeEvent(event);
- }
- };
- }
-
- public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE;
- }
-
- public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return buildResourceModel(file);
- }
-
- public JaxbPropertiesResource buildResourceModel(IFile file) {
- JaxbPropertiesResourceImpl resource = this.models.get(file);
- if (resource != null) {
- return resource;
- }
- resource = new JaxbPropertiesResourceImpl(file);
- this.models.put(file, resource);
- return resource;
- }
-
- protected void handleResourceChangeEvent(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE :
- removeProjectResources((IProject) event.getResource());
- return;
-
- case IResourceChangeEvent.POST_CHANGE :
- updateResources(event.getDelta());
- }
- }
-
- protected void removeProjectResources(IProject removedProject) {
- for (IFile file : new SnapshotCloneIterable<IFile>(this.models.keySet())) {
- if (file.getProject().equals(removedProject)) {
- removeResource(file);
- }
- }
- }
-
- protected void updateResources(IResourceDelta delta) {
- try {
- delta.accept(new ResourceDeltaVisitor());
- }
- catch (CoreException ce) {
- // shouldn't happen
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void removeResource(IFile file) {
- this.models.remove(file);
- }
-
- protected void updateResource(IFile file) {
- JaxbPropertiesResourceImpl resource = this.models.get(file);
- if (resource != null) {
- resource.update();
- }
- }
-
-
- protected class ResourceDeltaVisitor
- implements IResourceDeltaVisitor {
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (deltaKind == IResourceDelta.REMOVED) {
- JaxbPropertiesResourceModelProvider.this.removeResource(file);
- }
- else if (deltaKind == IResourceDelta.CHANGED) {
- JaxbPropertiesResourceModelProvider.this.updateResource(file);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
deleted file mode 100644
index d79d040b3e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class DefaultValidationMessages {
-
- private static String[] DEFAULT_PARMS = new String[0];
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JaxbNode targetObject) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JaxbNode targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JaxbNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JaxbNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, textRange, MESSAGE_FACTORY);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange, MessageFactory messageFactory) {
- IMessage message = messageFactory.buildMessage(defaultSeverity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
- if (textRange == null) {
- textRange = DEFAULT_TEXT_RANGE;
- // log the exception but allow the message to still be used
- JptJaxbCorePlugin.log(new NullPointerException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
- }
- int lineNumber = textRange.getLineNumber();
- message.setLineNo(lineNumber);
- if (lineNumber == IMessage.LINENO_UNSET) {
- message.setAttribute(IMarker.LOCATION, " "); //$NON-NLS-1$
- }
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- return message;
- }
-
-
- private DefaultValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** message factory **********
-
- /**
- * Allow clients to specify a message factory so the message can load the
- * appropriate resource bundle.
- */
- public interface MessageFactory {
- IMessage buildMessage(int severity, String messageId, String[] parms, IResource targetObject);
- }
-
- private static final MessageFactory MESSAGE_FACTORY = new GenericMessageFactory();
-
- /* CU private */ static class GenericMessageFactory
- implements MessageFactory
- {
- public IMessage buildMessage(int severity, String messageId, String[] parms, IResource targetObject) {
- // TODO check for preference override
-// int prefSeverity = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
-// if (prefSeverity != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
-// severity = prefSeverity;
-// }
- IMessage message = new Message(JaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
- return message;
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
deleted file mode 100644
index 04a0816a10..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-@SuppressWarnings("nls")
-public interface JaxbValidationMessages {
-
- // bundle name
- String BUNDLE_NAME = "jaxb_validation";
-
- // validation on project
-
- String NO_JAXB_PROJECT = "NO_JAXB_PROJECT";
- String PROJECT_INVALID_LIBRARY_PROVIDER = "PROJECT_INVALID_LIBRARY_PROVIDER";
- String PROJECT__UNRESOLVED_SCHEMA = "PROJECT__UNRESOLVED_SCHEMA";
- String PROJECT__DUPLICATE_NAMESPACE = "PROJECT__DUPLICATE_NAMESPACE";
-
-
- // validation on package
-
- String PACKAGE_NO_SCHEMA_FOR_NAMESPACE = "PACKAGE_NO_SCHEMA_FOR_NAMESPACE";
- String PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED = "PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED";
-
- String XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT = "XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT";
- String XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT = "XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT";
-
-
- // validation on type
-
- String XML_ENUM__NON_SIMPLE_SCHEMA_TYPE = "XML_ENUM__NON_SIMPLE_SCHEMA_TYPE";
-
- String XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = "XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE";
- String XML_TYPE__UNSPECIFIED_FACTORY_METHOD = "XML_TYPE__UNSPECIFIED_FACTORY_METHOD";
- String XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR = "XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR";
- String XML_TYPE__DUPLICATE_PROP = "XML_TYPE__DUPLICATE_PROP";
- String XML_TYPE__MISSING_PROP = "XML_TYPE__MISSING_PROP";
- String XML_TYPE__NONEXISTENT_PROP = "XML_TYPE__NONEXISTENT_PROP";
- String XML_TYPE__TRANSIENT_PROP = "XML_TYPE__TRANSIENT_PROP";
- String XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM = "XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM";
- String XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM = "XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM";
- String XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM = "XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM";
-
- String XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = "XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE";
-
-
- // validation on enum constant
-
- String XML_ENUM_VALUE__INVALID_LEXICAL_VALUE = "XML_ENUM_VALUE__INVALID_LEXICAL_VALUE";
-
-
- // validation on attribute
-
- String ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION = "ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION";
- String ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED = "ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED";
- String XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION = "XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION";
-
- String XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED = "XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED";
- String XML_ANY_ATTRIBUTE__NON_MAP_TYPE = "XML_ANY_ATTRIBUTE__NON_MAP_TYPE";
-
- String XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED = "XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED";
-
- String XML_ATTRIBUTE__INVALID_SCHEMA_TYPE = "XML_ATTRIBUTE__INVALID_SCHEMA_TYPE";
-
- String XML_ELEMENT__UNSPECIFIED_TYPE = "XML_ELEMENT__UNSPECIFIED_TYPE";
- String XML_ELEMENT__ILLEGAL_TYPE = "XML_ELEMENT__ILLEGAL_TYPE";
- String XML_ELEMENT__INVALID_SCHEMA_TYPE = "XML_ELEMENT__INVALID_SCHEMA_TYPE";
-
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE";
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM";
- String XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME = "XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME";
- String XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL = "XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL";
-
- String XML_ELEMENT_REF__UNSPECIFIED_TYPE = "XML_ELEMENT_REF__UNSPECIFIED_TYPE";
- String XML_ELEMENT_REF__ILLEGAL_TYPE = "XML_ELEMENT_REF__ILLEGAL_TYPE";
- String XML_ELEMENT_REF__NO_ROOT_ELEMENT = "XML_ELEMENT_REF__NO_ROOT_ELEMENT";
- String XML_ELEMENT_REF__NO_REGISTRY = "XML_ELEMENT_REF__NO_REGISTRY";
- String XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL = "XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL";
-
- String XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE = "XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE";
- String XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME = "XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE = "XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE";
- String XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME = "XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_ID__MULTIPLE_MAPPINGS_DEFINED = "XML_ID__MULTIPLE_MAPPINGS_DEFINED";
- String XML_ID__ATTRIBUTE_TYPE_NOT_STRING = "XML_ID__ATTRIBUTE_TYPE_NOT_STRING";
- String XML_ID__SCHEMA_TYPE_NOT_ID = "XML_ID__SCHEMA_TYPE_NOT_ID";
-
- String XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID = "XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID";
- String XML_ID_REF__SCHEMA_TYPE_NOT_IDREF = "XML_ID_REF__SCHEMA_TYPE_NOT_IDREF";
-
- String XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE = "XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE";
- String XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE = "XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE";
-
- String XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE = "XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE";
- String XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME = "XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_VALUE__MULTIPLE_MAPPINGS_DEFINED = "XML_VALUE__MULTIPLE_MAPPINGS_DEFINED";
- String XML_VALUE__NO_TEXT_CONTENT = "XML_VALUE__NO_TEXT_CONTENT";
- String XML_VALUE__INVALID_SCHEMA_TYPE = "XML_VALUE__INVALID_SCHEMA_TYPE";
-
- String XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = "XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED";
-
-
- // general validation
-
- String XML_SCHEMA_TYPE__NON_SIMPLE_TYPE = "XML_SCHEMA_TYPE__NON_SIMPLE_TYPE";
- String XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE = "XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE";
- String XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE = "XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE";
-
- String QNAME__MISSING_NAME = "QNAME__MISSING_NAME";
- String QNAME__UNRESOLVED_COMPONENT = "QNAME__UNRESOLVED_COMPONENT";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
deleted file mode 100644
index 7ae65d3882..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IProjectValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-/**
- * This class is referenced in the JAXB extension for the
- * WTP validator extension point.
- */
-public class JaxbValidator
- extends AbstractValidator
- implements IValidator {
-
- public JaxbValidator() {
- super();
- }
-
-
- // ********** IValidator implementation **********
-
- public void validate(IValidationContext context, IReporter reporter) {
- this.validate(reporter, ((IProjectValidationContext) context).getProject());
- }
-
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
-
- // ********** AbstractValidator implementation **********
-
- @Override
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE) {
- return null;
- }
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- IProject project = resource.getProject();
- this.clearMarkers(project);
- result.setSuspendValidation(project);
- this.validate(reporter, project);
- return result;
- }
-
-
- // ********** internal **********
-
- private void clearMarkers(IProject project) {
- try {
- this.clearMarkers_(project);
- } catch (CoreException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- private void clearMarkers_(IProject project) throws CoreException {
- IMarker[] markers = project.findMarkers(JptJaxbCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE);
- for (IMarker marker : markers) {
- marker.delete();
- }
- }
-
- private void validate(IReporter reporter, IProject project) {
- for (IMessage message : this.buildValidationMessages(reporter, project)) {
- // TODO check preferences for IGNORE
-// if (JpaValidationPreferences.problemIsNotIgnored(project, message.getId())) {
- reporter.addMessage(this, message);
-// }
-
- }
- }
-
- private Iterable<IMessage> buildValidationMessages(IReporter reporter, IProject project) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- return jaxbProject.getValidationMessages(reporter);
- }
- return new SingleElementIterable<IMessage>(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.NO_JAXB_PROJECT,
- project));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 0790fca4b1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.libprov;
-
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public interface JaxbLibraryProviderInstallOperationConfig
- extends JptLibraryProviderInstallOperationConfig {
-
- public static final String PROP_JAXB_PLATFORM = "JAXB_PLATFORM"; //$NON-NLS-1$
-
- JaxbPlatformDescription getJaxbPlatform();
-
- void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
deleted file mode 100644
index 0bd885ac84..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-/**
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatform {
-
- JaxbPlatformDescription getDescription();
-
- JaxbPlatformDefinition getDefinition();
-
-
- // ********** factory **********
-
- /**
- * Return a factory responsible for creating core (e.g. JaxbProject), resource
- * (e.g. PersistenceResource), and context (e.g. PersistenceUnit) model
- * objects
- */
- JaxbFactory getFactory();
-
-
- // ********** JAXB files **********
-
- /**
- * Return a JAXB file corresponding to the specified Eclipse file.
- * Return null if the file's content is unsupported.
- */
- JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file);
-
-
- // ********** Java annotations **********
-
- /**
- * Return an annotation provider responsible for determining what Java
- * annotations are supported and constructing java resource model objects.
- */
- AnnotationProvider getAnnotationProvider();
-
- /**
- * Return a formatter that can clean up the Java annotations added to source
- * code.
- */
- AnnotationEditFormatter getAnnotationEditFormatter();
-
-
- // ********** Java attribute mappings **********
-
- Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions();
-
- Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions();
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} that describes the interpretation of the attribute
- * as it exists, complete with annotations. It is assumed that the attribute's default mapping
- * has already been determined.
- * This may not be null (@see {@link NullSpecifiedJavaAttributeMappingDefinition},) else
- * an {@link IllegalStateException} is thrown.
- *
- * @param attribute The persistent attribute to analyze
- * @return The mapping definition describing the annotated state of the attribute
- */
- JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(JaxbPersistentAttribute attribute);
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} for the given mapping key.
- * Throw an {@link IllegalArgumentException} if the key is not supported by the platform.
- */
- JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
deleted file mode 100644
index c1ae7dc1c0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-/**
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDefinition {
-
- JaxbPlatformDescription getDescription();
-
- // ***** platform-y questions *****
-
- /**
- * Return the built in schema type name mapped by the given (fully qualified) java type name
- */
- String getSchemaTypeMapping(String javaTypeName);
-
-
- JaxbFactory getFactory();
-
- AnnotationDefinition[] getAnnotationDefinitions();
-
- NestableAnnotationDefinition[] getNestableAnnotationDefinitions();
-
- /**
- * Return the resource model providers that apply to this platform.
- */
- ListIterable<JaxbResourceModelProvider> getResourceModelProviders();
-
- /**
- * Return the most recent resource type for the given content type supported by this platform
- */
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType);
-
-// /**
-// * Return the resource definitions supported by this platform.
-// */
-// ListIterator<ResourceDefinition> resourceDefinitions();
-
- /**
- * Return the mapping definitions to use for default java attribute mappings for this platform.
- */
- Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions();
-
- /**
- * Return the mapping definitions to use for specified java attribute mappings for this platform.
- */
- Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java
deleted file mode 100644
index c27161a036..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-/**
- * This interface is to be implemented by a JAXB vendor to build a
- * {@link JaxbPlatformDefinition}.
- * <p>
- * See the <code>org.eclipse.jpt.jaxb.core.jaxbPlatforms</code> extension point.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDefinitionFactory {
-
- JaxbPlatformDefinition buildJaxbPlatformDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java
deleted file mode 100644
index 93fc5e47c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Contains metadata that describes a JAXB platform. Not intended to be implemented by clients.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDescription {
-
- public String getId();
-
- public String getPluginId();
-
- public String getLabel();
-
- public String getFactoryClassName();
-
- public boolean supportsJaxbFacetVersion(IProjectFacetVersion jpaFacetVersion);
-
- public boolean isDefault();
-
- public JaxbPlatformGroupDescription getGroup();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java
deleted file mode 100644
index 607c120a51..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-/**
- * Contains metadata that describes a JAXB platform group. Not intended to be implemented by clients.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformGroupDescription {
-
- public String getId();
-
- public String getPluginId();
-
- public String getLabel();
-
- public Iterable<JaxbPlatformDescription> getPlatforms();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java
deleted file mode 100644
index 1dca3072c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Entry point to the "jaxbPlatforms" extension point
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformManager {
-
- Iterable<JaxbPlatformGroupDescription> getJaxbPlatformGroups();
-
- JaxbPlatformGroupDescription getJaxbPlatformGroup(String groupId);
-
- Iterable<JaxbPlatformDescription> getJaxbPlatforms();
-
- JaxbPlatformDescription getJaxbPlatform(String platformId);
-
- /**
- * Returns the first JAXB platform registered as a default platform and which supports the given
- * JAXB facet version.
- * Returns null if there are no such registered platforms.
- */
- JaxbPlatformDescription getDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion);
-
- JaxbPlatformDefinition buildJaxbPlatformDefinition(IProject project);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
deleted file mode 100644
index 98b9150153..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * JAXB Java-related stuff (annotations etc.)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface JAXB {
-
- // JAXB packages
-
- String JAXB_PACKAGE = "javax.xml.bind";
- String JAXB_PACKAGE_ = JAXB_PACKAGE + '.';
-
- String JAXB_ANNOTATION_PACKAGE = "javax.xml.bind.annotation";
- String JAXB_ANNOTATION_PACKAGE_ = JAXB_ANNOTATION_PACKAGE + '.';
-
- String JAXB_ADAPTERS_PACKAGE = JAXB_ANNOTATION_PACKAGE_ + "adapters";
- String JAXB_ADAPTERS_PACKAGE_ = JAXB_ADAPTERS_PACKAGE + '.';
-
-
- // JAXB annotations
-
- String DEFAULT_STRING = "##default";
-
- String XML_ATTACHMENT_REF = JAXB_ANNOTATION_PACKAGE_ + "XmlAttachmentRef";
-
- String XML_ACCESSOR_ORDER = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessorOrder";
- String XML_ACCESSOR_ORDER__VALUE = "value";
-
- String XML_ACCESSOR_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessorType";
- String XML_ACCESSOR_TYPE__VALUE = "value";
-
- String XML_ANY_ATTRIBUTE = JAXB_ANNOTATION_PACKAGE_ + "XmlAnyAttribute";
-
- String XML_ANY_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlAnyElement";
- String XML_ANY_ELEMENT__LAX = "lax";
- String XML_ANY_ELEMENT__VALUE = "value";
-
- String XML_ATTRIBUTE = JAXB_ANNOTATION_PACKAGE_ + "XmlAttribute";
- String XML_ATTRIBUTE__NAME = "name";
- String XML_ATTRIBUTE__NAMESPACE = "namespace";
- String XML_ATTRIBUTE__REQUIRED = "required";
-
- String XML_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlElement";
- String XML_ELEMENT__NAME = "name";
- String XML_ELEMENT__NAMESPACE = "namespace";
- String XML_ELEMENT__DEFAULT_VALUE = "defaultValue";
- String XML_ELEMENT__NILLABLE = "nillable";
- String XML_ELEMENT__REQUIRED = "required";
- String XML_ELEMENT__TYPE = "type";
-
- String XML_ELEMENT_DECL = JAXB_ANNOTATION_PACKAGE_ + "XmlElementDecl";
- String XML_ELEMENT_DECL__NAME = "name";
- String XML_ELEMENT_DECL__NAMESPACE = "namespace";
- String XML_ELEMENT_DECL__DEFAULT_VALUE = "defaultValue";
- String XML_ELEMENT_DECL__SCOPE = "scope";
- String XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME = "substitutionHeadName";
- String XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE = "substitutionHeadNamespace";
-
- String XML_ELEMENTS = JAXB_ANNOTATION_PACKAGE_ + "XmlElements";
- String XML_ELEMENTS__VALUE = "value";
-
- String XML_ELEMENT_REF = JAXB_ANNOTATION_PACKAGE_ + "XmlElementRef";
- String XML_ELEMENT_REF__NAME = "name";
- String XML_ELEMENT_REF__NAMESPACE = "namespace";
- String XML_ELEMENT_REF__REQUIRED = "required";
- String XML_ELEMENT_REF__TYPE = "type";
-
- String XML_ELEMENT_REFS = JAXB_ANNOTATION_PACKAGE_ + "XmlElementRefs";
- String XML_ELEMENT_REFS__VALUE = "value";
-
- String XML_ELEMENT_WRAPPER = JAXB_ANNOTATION_PACKAGE_ + "XmlElementWrapper";
- String XML_ELEMENT_WRAPPER__NAME = "name";
- String XML_ELEMENT_WRAPPER__NAMESPACE = "namespace";
- String XML_ELEMENT_WRAPPER__NILLABLE = "nillable";
- String XML_ELEMENT_WRAPPER__REQUIRED = "required";
-
- String XML_ENUM = JAXB_ANNOTATION_PACKAGE_ + "XmlEnum";
- String XML_ENUM__VALUE = "value";
-
- String XML_ENUM_VALUE = JAXB_ANNOTATION_PACKAGE_ + "XmlEnumValue";
- String XML_ENUM_VALUE__VALUE = "value";
-
- String XML_INLINE_BINARY_DATA = JAXB_ANNOTATION_PACKAGE_ + "XmlInlineBinaryData";
-
- String XML_ID = JAXB_ANNOTATION_PACKAGE_ + "XmlID";
-
- String XML_IDREF = JAXB_ANNOTATION_PACKAGE_ + "XmlIDREF";
-
- String XML_JAVA_TYPE_ADAPTER = JAXB_ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapter";
- String XML_JAVA_TYPE_ADAPTER__TYPE = "type";
- String XML_JAVA_TYPE_ADAPTER__VALUE = "value";
-
- String XML_JAVA_TYPE_ADAPTERS = JAXB_ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapters";
- String XML_JAVA_TYPE_ADAPTERS__VALUE = "value";
-
- String XML_LIST = JAXB_ANNOTATION_PACKAGE_ + "XmlList";
-
- String XML_MIME_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlMimeType";
- String XML_MIME_TYPE__VALUE = "value";
-
- String XML_MIXED = JAXB_ANNOTATION_PACKAGE_ + "XmlMixed";
-
- String XML_NS = JAXB_ANNOTATION_PACKAGE_ + "XmlNs";
- String XML_NS__NAMESPACE_URI = "namespaceURI";
- String XML_NS__PREFIX = "prefix";
-
- String XML_REGISTRY = JAXB_ANNOTATION_PACKAGE_ + "XmlRegistry";
-
- String XML_ROOT_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlRootElement";
- String XML_ROOT_ELEMENT__NAME = "name";
- String XML_ROOT_ELEMENT__NAMESPACE = "namespace";
-
- String XML_SCHEMA = JAXB_ANNOTATION_PACKAGE_ + "XmlSchema";
- String XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault";
- String XML_SCHEMA__ELEMENT_FORM_DEFAULT = "elementFormDefault";
- String XML_SCHEMA__LOCATION = "location";
- String XML_SCHEMA__NAMESPACE = "namespace";
- String XML_SCHEMA__XMLNS = "xmlns";
-
- String XML_SCHEMA_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlSchemaType";
- String XML_SCHEMA_TYPE__NAME = "name";
- String XML_SCHEMA_TYPE__NAMESPACE = "namespace";
- String XML_SCHEMA_TYPE__TYPE = "type";
-
- String XML_SCHEMA_TYPES = JAXB_ANNOTATION_PACKAGE_ + "XmlSchemaTypes";
- String XML_SCHEMA_TYPES__VALUE = "value";
-
- String XML_SEE_ALSO = JAXB_ANNOTATION_PACKAGE_ + "XmlSeeAlso";
- String XML_SEE_ALSO__VALUE = "value";
-
- String XML_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlType";
- String XML_TYPE__FACTORY_CLASS = "factoryClass";
- String XML_TYPE__FACTORY_METHOD = "factoryMethod";
- String XML_TYPE__NAME = "name";
- String XML_TYPE__NAMESPACE = "namespace";
- String XML_TYPE__PROP_ORDER = "propOrder";
- String XML_TYPE__DEFAULT_FACTORY_CLASS = XML_TYPE + ".DEFAULT";
-
- String XML_TRANSIENT = JAXB_ANNOTATION_PACKAGE_ + "XmlTransient";
-
- String XML_VALUE = JAXB_ANNOTATION_PACKAGE_ + "XmlValue";
-
-
- // JAXB enums
-
- String XML_ACCESS_ORDER = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessOrder";
- String XML_ACCESS_ORDER_ = XML_ACCESS_ORDER + '.';
- String XML_ACCESS_ORDER__ALPHABETICAL = XML_ACCESS_ORDER_ + "ALPHABETICAL";
- String XML_ACCESS_ORDER__UNDEFINED = XML_ACCESS_ORDER_ + "UNDEFINED";
-
- String XML_ACCESS_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessType";
- String XML_ACCESS_TYPE_ = XML_ACCESS_TYPE + '.';
- String XML_ACCESS_TYPE__FIELD = XML_ACCESS_TYPE_ + "FIELD";
- String XML_ACCESS_TYPE__NONE = XML_ACCESS_TYPE_ + "NONE";
- String XML_ACCESS_TYPE__PROPERTY = XML_ACCESS_TYPE_ + "PROPERTY";
- String XML_ACCESS_TYPE__PUBLIC_MEMBER = XML_ACCESS_TYPE_ + "PUBLIC_MEMBER";
-
- String XML_NS_FORM = JAXB_ANNOTATION_PACKAGE_ + "XmlNsForm";
- String XML_NS_FORM_ = XML_NS_FORM + ".";
- String XML_NS_FORM__QUALIFIED = XML_NS_FORM_ + "QUALIFIED";
- String XML_NS_FORM__UNQUALIFIED = XML_NS_FORM_ + "UNQUALIFIED";
- String XML_NS_FORM__UNSET = XML_NS_FORM_ + "UNSET";
-
-
- // Other JAXB types
-
- String JAXB_ELEMENT = JAXB_PACKAGE_ + "JAXBElement";
-
- String XML_ADAPTER = JAXB_ADAPTERS_PACKAGE_ + "XmlAdapter";
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
deleted file mode 100644
index 5dd3b0d7de..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Super-interface for {@link XmlAttributeAnnotation} and {@link XmlElementAnnotation}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbBasicSchemaComponentAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'required' element of the XmlAttribute annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of the XmlAttribute annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the XmlAttribute annotation.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
deleted file mode 100644
index d87da74fbe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to JAXB annotations with namespace and name fields
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.?
- */
-public interface QNameAnnotation
- extends Annotation {
-
- /**
- * Constant associated with changes to the 'namespace' property
- */
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespace' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespace();
-
- /**
- * Corresponds to the 'namespace' element of the annotation.
- * Set to null to remove the element.
- */
- void setNamespace(String namespace);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespace' element.
- * Return false if the element does not exist.
- */
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Constant associated with changes to the 'name' property
- */
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
-
- /**
- * Corresponds to the 'name' element of the annotation.
- * Set to null to remove the element.
- */
- void setName(String name);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'name' element.
- * Return false if the element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java
deleted file mode 100644
index a7cbac73b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlAccessOrder
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessOrder {
-
- ALPHABETICAL(JAXB.XML_ACCESS_ORDER__ALPHABETICAL),
- UNDEFINED (JAXB.XML_ACCESS_ORDER__UNDEFINED);
-
-
- private String javaAnnotationValue;
-
- XmlAccessOrder(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessOrder fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlAccessOrder fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlAccessOrder accessType : XmlAccessOrder.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlAccessOrder accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java
deleted file mode 100644
index c3b3bd0967..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlAccessType
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessType {
-
- FIELD(JAXB.XML_ACCESS_TYPE__FIELD),
- NONE(JAXB.XML_ACCESS_TYPE__NONE),
- PROPERTY(JAXB.XML_ACCESS_TYPE__PROPERTY),
- PUBLIC_MEMBER(JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
-
-
- private String javaAnnotationValue;
-
- XmlAccessType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlAccessType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlAccessType accessType : XmlAccessType.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlAccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
deleted file mode 100644
index 5eb213ca01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAccessorOrder
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessorOrderAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorOrder annotation.
- * Return null if the element does not exist in Java.
- */
- XmlAccessOrder getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorOrder annotation.
- * Set to null to remove the element.
- */
- void setValue(XmlAccessOrder value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAccessorOrder annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
deleted file mode 100644
index b10dbac4b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAccessorType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessorTypeAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorType annotation.
- * Return null if the element does not exist in Java.
- */
- XmlAccessType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorType annotation.
- * Set to null to remove the element.
- */
- void setValue(XmlAccessType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAccessorType annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java
deleted file mode 100644
index 627356b2dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAnyAttribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyAttributeAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
deleted file mode 100644
index caf679c903..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAnyElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyElementAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'lax' element of the XmlAnyElement annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getLax();
- String LAX_PROPERTY = "lax"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'lax' element of the XmlAnyElement annotation.
- * Set to null to remove the element.
- */
- void setLax(Boolean lax);
-
- /**
- * Return the {@link TextRange} for the 'lax' element. If the element
- * does not exist return the {@link TextRange} for the XmlAnyElement annotation.
- */
- TextRange getLaxTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'value' element of the XmlAnyElement annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlAnyElement(value=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAnyElement annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAnyElement annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlAnyElement(value=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java
deleted file mode 100644
index 356c771be3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAttachmentRef
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttachmentRefAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
deleted file mode 100644
index 5fd86552fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010,2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAttribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttributeAnnotation
- extends JaxbBasicSchemaComponentAnnotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
deleted file mode 100644
index c57b458d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementAnnotation
- extends JaxbBasicSchemaComponentAnnotation, NestableAnnotation {
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultValue();
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setDefaultValue(String defaultValue);
-
- /**
- * Return the {@link TextRange} for the 'defaultValue' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'nillable' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNillable();
- String NILLABLE_PROPERTY = "nillable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nillable' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setNillable(Boolean nillable);
-
- /**
- * Return the {@link TextRange} for the 'nillable' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getNillableTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'type' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElement(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElement(type=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedTypeName();
- String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
deleted file mode 100644
index 9b3a83eaea..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementDecl
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementDeclAnnotation
- extends QNameAnnotation {
-
- // ***** scope *****
-
- /**
- * String associated with "scope" property changes.
- */
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'scope' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElementDecl(type=XmlElementDecl.GLOBAL.class)
- * </pre>
- * will return "XmlElementDecl.GLOBAL"
- */
- String getScope();
-
- /**
- * Corresponds to the 'scope' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setScope(String scope);
-
- /**
- * Return the {@link TextRange} for the 'scope' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getScopeTextRange(CompilationUnit astRoot);
-
- /**
- * String associated with "fullyQualifiedScopeClassName" property changes.
- */
- String FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY = "fullyQualifiedScopeClassName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified scope class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElementDecl(type=XmlElementDecl.GLOBAL.class)
- * </pre>
- * will return "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"
- */
- String getFullyQualifiedScopeClassName();
-
-
- // ***** substitution head namespace *****
-
- /**
- * String associated with "substitutionHeadNamespace" property changes.
- */
- String SUBSTITUTION_HEAD_NAMESPACE_PROPERTY = "substitutionHeadNamespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadNamespace();
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setSubstitutionHeadNamespace(String substitutionHeadNamespace);
-
- /**
- * Return the {@link TextRange} for the 'substitutionHeadNamespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'substitutionHeadNamespace' element.
- * Return false if the element does not exist.
- */
- boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot);
-
-
- // ***** substitution head name *****
-
- /**
- * String associated with "substitutionHeadName" property changes.
- */
- String SUBSTITUTION_HEAD_NAME_PROPERTY = "substitutionHeadName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadName();
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setSubstitutionHeadName(String substitutionHeadName);
-
- /**
- * Return the {@link TextRange} for the 'substitutionHeadName' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'substitutionHeadName' element.
- * Return false if the element does not exist.
- */
- boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot);
-
-
- // ***** default value *****
-
- /**
- * String associated with "defaultValue" property changes.
- */
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultValue();
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setDefaultValue(String defaultValue);
-
- /**
- * Return the {@link TextRange} for the 'defaultValue' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
deleted file mode 100644
index 6b6d9b873c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementRef
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementRefAnnotation
- extends QNameAnnotation, NestableAnnotation {
-
- // ***** required *****
-
- /**
- * String associated with changes to the 'required' property of this annotation.
- */
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of this annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
-
- /**
- * Corresponds to the 'required' element of this annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-
-
- // ***** type *****
-
- /**
- * String associated with changes to the 'type' property of this annotation.
- */
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of this annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElementRef(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
-
- /**
- * Corresponds to the 'type' element of this annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * String associated with changes to the 'fullyQualifiedName' property of this annotation.
- */
- String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElementRef(type=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedTypeName();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java
deleted file mode 100644
index 3b10f27f39..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementRefs
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementRefsAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlElementRefAnnotation> getXmlElementRefs();
- String XML_ELEMENT_REFS_LIST = "xmlElementRefs"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- int getXmlElementRefsSize();
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- XmlElementRefAnnotation xmlElementRefAt(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- XmlElementRefAnnotation addXmlElementRef(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- void moveXmlElementRef(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- void removeXmlElementRef(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
deleted file mode 100644
index aaacd081a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementWrapper
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementWrapperAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'nillable' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNillable();
- String NILLABLE_PROPERTY = "nillable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nillable' element of the XmlElementWrapper annotation.
- * Set to null to remove the element.
- */
- void setNillable(Boolean nillable);
-
- /**
- * Return the {@link TextRange} for the 'nillable' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
- */
- TextRange getNillableTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'required' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of the XmlElementWrapper annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java
deleted file mode 100644
index 016d1806b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementsAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlElementAnnotation> getXmlElements();
- String XML_ELEMENTS_LIST = "xmlElements"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- int getXmlElementsSize();
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- XmlElementAnnotation xmlElementAt(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- XmlElementAnnotation addXmlElement(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- void moveXmlElement(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- void removeXmlElement(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
deleted file mode 100644
index 1afc8ca88e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlEnum
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlEnumAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlEnum annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlEnum(value=EnumClass.class)
- * </pre>
- * will return "EnumClass"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlEnum annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlEnum annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlEnum(value=EnumClass.class)
- * </pre>
- * will return "model.EnumClass" if there is an import for model.EnumClass.
- * @return
- */
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
deleted file mode 100644
index 6d70a2843c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlEnumValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlEnumValueAnnotation
- extends Annotation {
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlEnumValue annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the given position touches the 'value' element value.
- */
- boolean valueTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java
deleted file mode 100644
index e783bd107a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlID
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java
deleted file mode 100644
index c6cfad2def..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlIDREF
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDREFAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index c299919dbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlInlineBinaryData
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlInlineBinaryDataAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 3abc2cdead..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlJavaTypeAdapterAnnotation
- extends NestableAnnotation {
-
- /**
- * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(value=FooAdapter.class)
- * </pre>
- * will return "FooAdapter"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the value's fully-qualified class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlJavaTypeAdapter(FooAdapter.class)
- * </pre>
- * will return "example.FooAdapter" if there is an import for example.FooAdapter.
- */
- String getFullyQualifiedValue();
- String FULLY_QUALIFIED_VALUE_PROPERTY = "fullyQualifiedValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlJavaTypeAdapter annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlJavaTypeAdapter annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the type's fully-qualified class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlJavaTypeAdapter(type=Foo.class)
- * </pre>
- * will return "example.Foo" if there is an import for example.Foo.
- */
- String getFullyQualifiedType();
- String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java
deleted file mode 100644
index 5446e4681f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlList
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlListAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
deleted file mode 100644
index 773ade4495..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlMimeType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMimeTypeAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlMimeType annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlMimeType annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlMimeType annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java
deleted file mode 100644
index a792c4215f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlMixed
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMixedAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
deleted file mode 100644
index fc9a9d8232..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlNs
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlNsAnnotation
- extends NestableAnnotation {
-
- // ***** namespaceURI *****
-
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespaceURI();
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Set to null to remove the element.
- */
- void setNamespaceURI(String namespaceURI);
-
- /**
- * Return the {@link TextRange} for the 'namespaceURI' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getNamespaceURITextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespaceURI' element.
- * Return false if the element does not exist.
- */
- boolean namespaceURITouches(int pos, CompilationUnit astRoot);
-
-
- // ***** prefix *****
-
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getPrefix();
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Set to null to remove the element.
- */
- void setPrefix(String prefix);
-
- /**
- * Return the {@link TextRange} for the 'prefix' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getPrefixTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'prefix' element.
- * Return false if the element does not exist.
- */
- boolean prefixTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
deleted file mode 100644
index 4d73541c8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlNsForm
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlNsForm {
-
- QUALIFIED(JAXB.XML_NS_FORM__QUALIFIED),
- UNQUALIFIED(JAXB.XML_NS_FORM__UNQUALIFIED),
- UNSET(JAXB.XML_NS_FORM__UNSET);
-
-
- private String javaAnnotationValue;
-
- XmlNsForm(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlNsForm fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlNsForm fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlNsForm nsForm : XmlNsForm.values()) {
- if (nsForm.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return nsForm;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlNsForm nsForm) {
- return (nsForm == null) ? null : nsForm.getJavaAnnotationValue();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java
deleted file mode 100644
index 07e6aef4d2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlRegistry
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRegistryAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java
deleted file mode 100644
index e18fc961e2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlRootElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRootElementAnnotation
- extends QNameAnnotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
deleted file mode 100644
index 0908506c0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSchema
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- XmlNsForm getAttributeFormDefault();
- String ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setAttributeFormDefault(XmlNsForm attributeFormDefault);
-
- /**
- * Return the {@link TextRange} for the 'attributeFormDefault' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- XmlNsForm getElementFormDefault();
- String ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setElementFormDefault(XmlNsForm elementFormDefault);
-
- /**
- * Return the {@link TextRange} for the 'elementFormDefault' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getElementFormDefaultTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'location' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- String getLocation();
- String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'location' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setLocation(String location);
-
- /**
- * Return the {@link TextRange} for the 'location' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getLocationTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespace();
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setNamespace(String namespace);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespace' element.
- * Return false if the element does not exist.
- */
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlNsAnnotation> getXmlns();
- String XMLNS_LIST = "xmlns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- int getXmlnsSize();
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annnotation.
- */
- XmlNsAnnotation xmlnsAt(int index);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- XmlNsAnnotation addXmlns(int index);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- void moveXmlns(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- void removeXmlns(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
deleted file mode 100644
index f6a255e72c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSchemaType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaTypeAnnotation
- extends QNameAnnotation, NestableAnnotation {
-
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlSchemaType annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
- * </pre>
- * will return "XMLGregorianCalendar"
- */
- String getType();
-
- /**
- * Corresponds to the 'type' element of the XmlSchemaType annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchemaType annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
- * </pre>
- * will return "javax.xml.datatype.XMLGregorianCalendar" if there is an import for
- * javax.xml.datatype.XMLGregorianCalendar.
- * @return
- */
- String getFullyQualifiedType();
-
- /**
- * The default type when none is specified
- */
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
deleted file mode 100644
index 102f86401e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSeeAlso
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSeeAlsoAnnotation
- extends Annotation {
-
- /**
- * Change notification constant associated with the value element
- */
- String CLASSES_LIST = "classes"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- * Return an empty iterator if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlSeeAlso({Foo.class, Bar.class})
- * </pre>
- * will return and iterable containing: "Foo", "Bar"
- */
- ListIterable<String> getClasses();
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- int getClassesSize();
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void addClass(String clazz);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void addClass(int index, String clazz);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void moveClass(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void removeClass(int index);
-
- /**
- * Change notification constant associated with the fully qualified classes.
- * Changes should occur whenever changes occur to the "classes" list, but
- * may also occur with changes to the classes resolution state (import changes, e.g.)
- */
- String FULLY_QUALIFIED_CLASSES_LIST = "fullyQualifiedClasses"; //$NON-NLS-1$
-
- /**
- * Return the value elements resolved to fully qualified class names
- */
- ListIterable<String> getFullyQualifiedClasses();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java
deleted file mode 100644
index f2d67206d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlTransient
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlTransientAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
deleted file mode 100644
index 781cde998e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.0
- */
-public interface XmlTypeAnnotation
- extends QNameAnnotation {
-
- // ***** factory class *****
-
- String FACTORY_CLASS_PROPERTY = "factoryClass"; //$NON-NLS-1$
-
- String DEFAULT_FACTORY_CLASS = JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS;
-
- /**
- * Corresponds to the 'factoryClass' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class)
- * </pre>
- * will return "USAddressFactory"
- */
- String getFactoryClass();
-
- /**
- * Corresponds to the 'factoryClass' element of the XmlType annotation.
- * Set to null to remove the element.
- */
- void setFactoryClass(String factoryClass);
-
- /**
- * Return the {@link TextRange} for the 'factoryClass' element. If the element
- * does not exist return the {@link TextRange} for the XmlType annotation.
- */
- TextRange getFactoryClassTextRange(CompilationUnit astRoot);
-
- String FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY = "fullyQualifiedFactoryClassName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified factory class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class)
- * </pre>
- * will return "model.USAddressFactory" if there is an import for model.USAddressFactory.
- * @return
- */
- String getFullyQualifiedFactoryClassName();
-
-
- // ***** factory method *****
-
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- */
- String getFactoryMethod();
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Set to null to remove the element.
- */
- void setFactoryMethod(String factoryMethod);
-
- /**
- * Return the {@link TextRange} for the 'factoryMethod' element. If the element
- * does not exist return the {@link TextRange} for the XmlType annotation.
- */
- TextRange getFactoryMethodTextRange(CompilationUnit astRoot);
-
-
- // ***** prop order *****
-
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * A single element empty string array should be interpreted as unspecified
- */
- String[] DEFAULT_PROP_ORDER = new String[] { "" };
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<String> getPropOrder();
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- int getPropOrderSize();
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void addProp(String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void addProp(int index, String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void moveProp(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void removeProp(String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void removeProp(int index);
-
- /**
- * Return the text range of the 'propOrder' element of the XmlType annotation.
- */
- TextRange getPropOrderTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'propOrder' element.
- * Return false if the element does not exist.
- */
- boolean propOrderTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the text range of the prop at the specified index
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- TextRange getPropTextRange(int index, CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the prop at the specified index.
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- boolean propTouches(int index, int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java
deleted file mode 100644
index b1936550e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlValueAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
deleted file mode 100644
index 22275336cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.jaxbindex;
-
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-
-public interface JaxbIndexResource
- extends JptResourceModel {
-
- String getPackageName();
-
- Iterable<String> getFullyQualifiedClassNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
deleted file mode 100644
index 8d0931ae4e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.jaxbprops;
-
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-
-public interface JaxbPropertiesResource
- extends JptResourceModel {
-
- String getPackageName();
-
- String getProperty(String propertyName);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java
deleted file mode 100644
index 81c7a42a80..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.util.Stack;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-public class XSDNodeVisitor {
-
- private Stack<XSDComponent> visitedNodeStack = new Stack<XSDComponent>();
-
- protected boolean visitChildren = true;
-
- protected boolean visitChildren() {
- return this.visitChildren;
- }
-
- public void visitNode(XSDComponent node) {
- if (node != null && ! visitedNodeStack.contains(node)) {
- visitedNodeStack.push(node);
- XSDSwitch xsdSwitch = new XSDSwitch() {
- @Override
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
- visitXSDAttributeDeclaration(object);
- return null;
- }
-
- @Override
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
- visitXSDAttributeGroupDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDAttributeUse(XSDAttributeUse object) {
- visitXSDAttributeUse(object);
- return null;
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- visitXSDComplexTypeDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- visitXSDElementDeclaration(object);
- return null;
- }
-
- @Override
- public Object caseXSDModelGroup(XSDModelGroup object) {
- visitXSDModelGroup(object);
- return null;
- }
-
- @Override
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
- visitXSDModelGroupDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDParticle(XSDParticle object) {
- visitXSDParticle(object);
- return null;
- }
-
- @Override
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- visitXSDSimpleTypeDefinition(object);
- return null;
- }
- };
- xsdSwitch.doSwitch(node);
- visitedNodeStack.pop();
- }
- }
-
- public void visitXSDAttributeDeclaration(XSDAttributeDeclaration node) {}
-
- public void visitXSDAttributeGroupDefinition(XSDAttributeGroupDefinition node) {
- if (visitChildren()) {
- for (XSDAttributeUse attrUse : node.getAttributeUses()) {
- visitNode(attrUse);
- }
- }
- }
-
- public void visitXSDAttributeUse(XSDAttributeUse node) {}
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition node) {
- if (node.getBaseType() != null) {
- visitNode(node.getBaseType());
- }
-
- if (visitChildren()) {
- for (XSDAttributeUse attrUse : node.getAttributeUses()) {
- visitNode(attrUse);
- }
-
- if (node.getContent() != null) {
- visitNode(node.getContent());
- }
- }
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration node) {
- for (XSDElementDeclaration element : node.getSubstitutionGroup()) {
- visitNode(element);
- }
-
- if (visitChildren()) {
- if (node.getTypeDefinition() != null) {
- visitNode(node.getTypeDefinition());
- }
- }
- }
-
- public void visitXSDModelGroup(XSDModelGroup node) {
- if (visitChildren()) {
- for (XSDParticle particle : node.getParticles()) {
- visitNode(particle);
- }
- }
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition node) {
- if (node.getModelGroup() != null) {
- visitNode(node.getModelGroup());
- }
- }
-
- public void visitXSDParticle(XSDParticle node) {
- if (node.getTerm() != null) {
- visitNode(node.getTerm());
- }
- }
-
- public void visitXSDSimpleTypeDefinition(XSDSimpleTypeDefinition node) {
- if (node.getBaseType() != null) {
- visitNode(node.getBaseType());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java
deleted file mode 100644
index df54aa1b8a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XsdAttributeDeclaration
- extends XsdFeature<XSDAttributeDeclaration> {
-
- XsdAttributeDeclaration(XSDAttributeDeclaration xsdAttributeDeclaration) {
- super(xsdAttributeDeclaration);
- }
-
-
- @Override
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = getXSDComponent().getType();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-
- @Override
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType) {
- return getType().typeIsValid(xsdType, isItemType);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java
deleted file mode 100644
index 3feb1b3778..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-
-
-public class XsdAttributeGroupDefinition
- extends XsdComponent<XSDAttributeGroupDefinition> {
-
- XsdAttributeGroupDefinition(XSDAttributeGroupDefinition xsdAttributeGroupDefinition) {
- super(xsdAttributeGroupDefinition);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java
deleted file mode 100644
index 059cfd3654..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-
-
-public class XsdAttributeUse
- extends XsdComponent<XSDAttributeUse> {
-
-
- XsdAttributeUse(XSDAttributeUse xsdAttributeUse) {
- super(xsdAttributeUse);
- }
-
-
- public XsdAttributeDeclaration getAttributeDeclaration() {
- XSDAttributeDeclaration xsdAttribute = getXSDComponent().getAttributeDeclaration();
- return (xsdAttribute == null) ? null : (XsdAttributeDeclaration) XsdUtil.getAdapter(xsdAttribute);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
deleted file mode 100644
index 2102907758..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDContentTypeCategory;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-
-public class XsdComplexTypeDefinition
- extends XsdTypeDefinition<XSDComplexTypeDefinition> {
-
- XsdComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition) {
- super(xsdComplexTypeDefinition);
- }
-
-
- @Override
- public org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition.Kind getKind() {
- return Kind.COMPLEX;
- }
-
- @Override
- public boolean hasTextContent() {
- return getXSDComponent().getContentTypeCategory() == XSDContentTypeCategory.SIMPLE_LITERAL;
- }
-
- @Override
- public XsdAttributeUse getAttribute(String namespace, String name) {
- for (XsdAttributeUse attrUse : getAttributeUses(namespace)) {
- if (attrUse.getXSDComponent().getAttributeDeclaration().getName().equals(name)) {
- return attrUse;
- }
- }
- return null;
- }
-
- @Override
- public Iterable<String> getAttributeNames(String namespace) {
- return new TransformationIterable<XsdAttributeUse, String>(getAttributeUses(namespace)) {
- @Override
- protected String transform(XsdAttributeUse attrUse) {
- return attrUse.getXSDComponent().getAttributeDeclaration().getName();
- }
- };
- }
-
- protected Iterable<XsdAttributeUse> getAttributeUses(final String namespace) {
- return new TransformationIterable<XSDAttributeUse, XsdAttributeUse>(
- new FilteringIterable<XSDAttributeUse>(getXSDComponent().getAttributeUses()) {
- @Override
- protected boolean accept(XSDAttributeUse attrUse) {
- return XsdUtil.namespaceEquals(attrUse.getAttributeDeclaration(), namespace);
- }
- }) {
- @Override
- protected XsdAttributeUse transform(XSDAttributeUse attrUse) {
- return (XsdAttributeUse) XsdUtil.getAdapter(attrUse);
- }
- };
- }
-
- @Override
- public XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren) {
- for (XsdElementDeclaration element : getElementDeclarations(namespace, recurseChildren)) {
- if (element.getXSDComponent().getName().equals(name)) {
- return element;
- }
- }
- return null;
- }
-
- @Override
- public Iterable<String> getElementNames(String namespace, boolean recurseChildren) {
- return new TransformationIterable<XsdElementDeclaration, String>(getElementDeclarations(namespace, recurseChildren)) {
- @Override
- protected String transform(XsdElementDeclaration element) {
- return element.getXSDComponent().getName();
- }
- };
- }
-
- protected Iterable<XsdElementDeclaration> getElementDeclarations(final String namespace, boolean recurseChildren) {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(
- new FilteringIterable<XSDElementDeclaration>(getXSDElementDeclarations(recurseChildren)) {
- @Override
- protected boolean accept(XSDElementDeclaration element) {
- return XsdUtil.namespaceEquals(element, namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration element) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(element);
- }
- };
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations(boolean recurseChildren) {
- ElementFinder elementFinder = new ElementFinder(recurseChildren);
- elementFinder.visitNode(getXSDComponent());
- return elementFinder.getElements();
- }
-
-
- private class ElementFinder
- extends XSDNodeVisitor {
-
- private boolean recurseChildren;
-
- private List<XSDElementDeclaration> elements = new ArrayList<XSDElementDeclaration>();
-
-
- private ElementFinder(boolean recurseChildren) {
- this.recurseChildren = recurseChildren;
- }
-
-
- @Override
- protected boolean visitChildren() {
- return super.visitChildren() || this.recurseChildren;
- }
-
- @Override
- public void visitXSDElementDeclaration(XSDElementDeclaration node) {
- boolean cachedVisitChildren = this.visitChildren;
- this.visitChildren = false;
- super.visitXSDElementDeclaration(node);
- if (! this.elements.contains(node)) {
- elements.add(node);
- }
- this.visitChildren = cachedVisitChildren;
- }
-
- public Iterable<XSDElementDeclaration> getElements() {
- return this.elements;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java
deleted file mode 100644
index fb7fec486b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-public class XsdComponent<A extends XSDConcreteComponent>
- extends AdapterImpl {
-
- protected final A xsdComponent;
-
-
- protected XsdComponent(A xsdComponent) {
- super();
- this.xsdComponent = xsdComponent;
- }
-
-
- public A getXSDComponent() {
- return this.xsdComponent;
- }
-
- @Override
- public boolean isAdapterForType(Object type) {
- return type == XsdUtil.adapterFactory;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java
deleted file mode 100644
index 4f9572fb0e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSubstitutionGroupExclusions;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Adds API to {@link XSDElementDeclaration}.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.1
- */
-public class XsdElementDeclaration
- extends XsdFeature<XSDElementDeclaration> {
-
- XsdElementDeclaration(XSDElementDeclaration xsdElementDeclaration) {
- super(xsdElementDeclaration);
- }
-
-
- public XSDElementDeclaration getXSDElementDeclaration() {
- return getXSDFeature();
- }
-
- @Override
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = getXSDElementDeclaration().getTypeDefinition();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-
- @Override
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType) {
- XSDElementDeclaration xsdElement = getXSDComponent();
- boolean allowExtension = true;
- boolean allowRestriction = true;
- XSDElementDeclaration xsdSubstitutionGroupAffiliation = xsdElement.getSubstitutionGroupAffiliation();
- if (xsdSubstitutionGroupAffiliation != null) {
- EList<XSDSubstitutionGroupExclusions> xsdSubstitutionGroupExclusions
- = xsdSubstitutionGroupAffiliation.getSubstitutionGroupExclusions();
- allowExtension = ! xsdSubstitutionGroupExclusions.contains(XSDSubstitutionGroupExclusions.EXTENSION_LITERAL);
- allowRestriction = ! xsdSubstitutionGroupExclusions.contains(XSDSubstitutionGroupExclusions.RESTRICTION_LITERAL);
- }
- return getType().typeIsValid(xsdType, isItemType, allowExtension, allowRestriction);
- }
-
- public XsdElementDeclaration getElement(String namespace, String name) {
- XsdTypeDefinition type = getType();
- return (type == null) ? null : type.getElement(namespace, name);
- }
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return getType().getElementNameProposals(namespace, filter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java
deleted file mode 100644
index 120f69dfe9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDFeature;
-
-
-public abstract class XsdFeature<A extends XSDFeature>
- extends XsdComponent<A> {
-
- protected XsdFeature(A xsdFeature) {
- super(xsdFeature);
- }
-
-
- public A getXSDFeature() {
- return getXSDComponent();
- }
-
- public String getName() {
- return getXSDFeature().getName();
- }
-
- public abstract XsdTypeDefinition getType();
-
- /**
- * Return whether the given schema type is valid within the feature
- * @param isItemType determines whether the xsdType should instead be treated as an item type
- * within a list
- */
- public abstract boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java
deleted file mode 100644
index ecda07b617..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDModelGroup;
-
-
-public class XsdModelGroup
- extends XsdComponent<XSDModelGroup> {
-
- XsdModelGroup(XSDModelGroup xsdModelGroup) {
- super(xsdModelGroup);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java
deleted file mode 100644
index 7e9c2a7385..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-
-public class XsdModelGroupDefinition
- extends XsdComponent<XSDModelGroupDefinition> {
-
- XsdModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition) {
- super(xsdModelGroupDefinition);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java
deleted file mode 100644
index 23bbf9c99e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDParticle;
-
-
-public class XsdParticle
- extends XsdComponent<XSDParticle> {
-
- XsdParticle(XSDParticle xsdParticle) {
- super(xsdParticle);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
deleted file mode 100644
index 8fc31d0473..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDUtil;
-
-public class XsdSchema
- extends XsdComponent<XSDSchema> {
-
- XsdSchema(XSDSchema xsdSchema) {
- super(xsdSchema);
- }
-
-
- public XSDSchema getXSDSchema() {
- return getXSDComponent();
- }
-
- public Iterable<String> getNamespaces() {
- Iterable<String> result = new SnapshotCloneIterable(getXSDSchema().getQNamePrefixToNamespaceMap().values());
- if (StringTools.stringIsEmpty(getXSDSchema().getTargetNamespace())) {
- result = new CompositeIterable<String>("", result);
- }
- return result;
- }
-
- public Iterable<XsdTypeDefinition> getAllTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getAllXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getDeclaredTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getDeclaredXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getBuiltInTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getBuiltInXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getTypeDefinitions(final String namespace) {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getXSDTypeDefinitions(namespace)) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdSimpleTypeDefinition> getSimpleTypeDefinitions(final String namespace) {
- return new TransformationIterable<XSDSimpleTypeDefinition, XsdSimpleTypeDefinition>(
- getXSDSimpleTypeDefinitions(namespace)) {
- @Override
- protected XsdSimpleTypeDefinition transform(XSDSimpleTypeDefinition o) {
- return (XsdSimpleTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- /**
- * by default, return a type with the given name and the schema's target namespace
- */
- public XsdTypeDefinition getTypeDefinition(String name) {
- return getTypeDefinition(getXSDComponent().getTargetNamespace(), name);
- }
-
- public XsdTypeDefinition getTypeDefinition(String namespace, String name) {
- for (XSDTypeDefinition typeDefinition : getXSDTypeDefinitions(namespace)) {
- if (XsdUtil.namespaceEquals(typeDefinition, namespace) && typeDefinition.getName().equals(name)) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(typeDefinition);
- }
- }
- return null;
- }
-
- protected Iterable<XSDTypeDefinition> getAllXSDTypeDefinitions() {
- return new CompositeIterable<XSDTypeDefinition>(
- getDeclaredXSDTypeDefinitions(), getBuiltInXSDTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getDeclaredXSDTypeDefinitions() {
- return new SnapshotCloneIterable(getXSDSchema().getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getBuiltInXSDTypeDefinitions() {
- return new SnapshotCloneIterable(getXSDSchema().getSchemaForSchema().getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getXSDTypeDefinitions(final String namespace) {
- if (XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace)) {
- return getBuiltInXSDTypeDefinitions();
- }
- return new FilteringIterable<XSDTypeDefinition>(getDeclaredXSDTypeDefinitions()) {
- @Override
- protected boolean accept(XSDTypeDefinition o) {
- return XsdUtil.namespaceEquals(o, namespace);
- }
- };
- }
-
- protected Iterable<XSDSimpleTypeDefinition> getXSDSimpleTypeDefinitions(String namespace) {
- return new TransformationIterable<XSDTypeDefinition, XSDSimpleTypeDefinition>(
- new FilteringIterable<XSDTypeDefinition>(getXSDTypeDefinitions(namespace)) {
- @Override
- protected boolean accept(XSDTypeDefinition o) {
- return o instanceof XSDSimpleTypeDefinition;
- }
- }) {
- @Override
- protected XSDSimpleTypeDefinition transform(XSDTypeDefinition o) {
- return (XSDSimpleTypeDefinition) o;
- }
- };
- }
-
- public Iterable<XsdElementDeclaration> getElementDeclarations() {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(getXSDElementDeclarations()) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdElementDeclaration> getElementDeclarations(final String namespace) {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(
- new FilteringIterable<XSDElementDeclaration>(getXSDElementDeclarations()) {
- @Override
- protected boolean accept(XSDElementDeclaration o) {
- return XsdUtil.namespaceEquals(o, namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public XsdElementDeclaration getElementDeclaration(String namespace, String name) {
- for (XSDElementDeclaration elementDeclaration : getXSDElementDeclarations()) {
- if (XsdUtil.namespaceEquals(elementDeclaration, namespace) && elementDeclaration.getName().equals(name)) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(elementDeclaration);
- }
- }
- return null;
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations() {
- return new SnapshotCloneIterable(getXSDSchema().getElementDeclarations());
- }
-
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getNamespaces(), filter));
- }
-
- public Iterable<String> getTypeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdTypeDefinition, String>(this.getTypeDefinitions(namespace)) {
- @Override
- protected String transform(XsdTypeDefinition o) {
- return o.getName();
- }
- },
- filter));
- }
-
- public Iterable<String> getSimpleTypeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdSimpleTypeDefinition, String>(this.getSimpleTypeDefinitions(namespace)) {
- @Override
- protected String transform(XsdSimpleTypeDefinition o) {
- return o.getName();
- }
- },
- filter));
- }
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdElementDeclaration, String>(this.getElementDeclarations(namespace)) {
- @Override
- protected String transform(XsdElementDeclaration o) {
- return o.getName();
- }
- },
- filter));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java
deleted file mode 100644
index ee467ba76f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-
-
-public class XsdSimpleTypeDefinition
- extends XsdTypeDefinition<XSDSimpleTypeDefinition> {
-
- XsdSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
- super(xsdSimpleTypeDefinition);
- }
-
-
- @Override
- public org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition.Kind getKind() {
- return Kind.SIMPLE;
- }
-
- @Override
- public boolean hasTextContent() {
- return true;
- }
-
- @Override
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType, boolean allowExtension, boolean allowRestriction) {
- if (isItemType) {
- XsdSimpleTypeDefinition itemType = getItemType();
- return (itemType == null) ? false : itemType.typeIsValid(xsdType, false, allowExtension, allowRestriction);
- }
- if (getXSDComponent().getVariety() == XSDVariety.UNION_LITERAL) {
- if (XsdUtil.getSchemaForSchema().getTypeDefinition("string").typeIsValid(xsdType, isItemType, allowExtension, allowRestriction)) {
- return true;
- }
- }
- return super.typeIsValid(xsdType, isItemType, allowExtension, allowRestriction);
- }
-
- /**
- * If the type is of variety LIST, this will return the item type of the list
- */
- public XsdSimpleTypeDefinition getItemType() {
- XSDSimpleTypeDefinition xsdItemType = getXSDComponent().getItemTypeDefinition();
- return (xsdItemType == null) ? null : (XsdSimpleTypeDefinition) XsdUtil.getAdapter(xsdItemType);
- }
-
- /**
- * If the type is of variety UNION, this will return the member types of the union
- */
- public Iterable<XsdSimpleTypeDefinition> getMemberTypes() {
- return new TransformationIterable<XSDSimpleTypeDefinition, XsdSimpleTypeDefinition>(
- getXSDComponent().getMemberTypeDefinitions()) {
- @Override
- protected XsdSimpleTypeDefinition transform(XSDSimpleTypeDefinition o) {
- return (XsdSimpleTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- @Override
- public XsdAttributeUse getAttribute(String namespace, String name) {
- // simple types have no attributes
- return null;
- }
-
- @Override
- public Iterable<String> getAttributeNames(String namespace) {
- // simple types have no attributes
- return EmptyIterable.instance();
- }
-
- @Override
- public XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren) {
- // simple types have no elements
- return null;
- }
-
- @Override
- public Iterable<String> getElementNames(String namespace, boolean recurseChildren) {
- // simple types have no elements
- return EmptyIterable.instance();
- }
-
- public Iterable<String> getEnumValueProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XSDEnumerationFacet, String>(getXSDComponent().getEnumerationFacets()) {
- @Override
- protected String transform(XSDEnumerationFacet enumFacet) {
- return enumFacet.getLexicalValue();
- }
- },
- filter));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java
deleted file mode 100644
index ea01a47c96..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Adds API to {@link XSDTypeDefinition}.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.1
- */
-public abstract class XsdTypeDefinition<A extends XSDTypeDefinition>
- extends XsdComponent<A> {
-
- protected XsdTypeDefinition(A xsdTypeDefinition) {
- super(xsdTypeDefinition);
- }
-
-
- // for some reason, the compiler is not recognizing the XSD component of this type as extending
- // XSDTypeDefinition without implementing this method.
- @Override
- public A getXSDComponent() {
- return super.getXSDComponent();
- }
-
- public abstract Kind getKind();
-
- public String getName() {
- return getXSDComponent().getName();
- }
-
- public abstract boolean hasTextContent();
-
- public boolean matches(String namespace, String name) {
- return XsdUtil.namespaceEquals(getXSDComponent(), namespace) && StringTools.stringsAreEqual(getName(), name);
- }
-
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType) {
- return typeIsValid(xsdType, isItemType, true, true);
- }
-
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType, boolean allowExtension, boolean allowRestriction) {
- return getXSDComponent().getBadTypeDerivation(xsdType.getXSDComponent(), allowExtension, allowRestriction) == null;
- }
-
- public XsdTypeDefinition getBaseType() {
- XSDTypeDefinition xsdBaseType = getXSDComponent().getBaseType();
- return (xsdBaseType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdBaseType);
- }
-
- public abstract XsdAttributeUse getAttribute(String namespace, String name);
-
- public Iterable<String> getAttributeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getAttributeNames(namespace), filter));
- }
-
- public abstract Iterable<String> getAttributeNames(String namespace);
-
- public XsdElementDeclaration getElement(String namespace, String name) {
- return getElement(namespace, name, false);
- }
-
- public abstract XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren);
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return getElementNameProposals(namespace, filter, false);
- }
-
- public Iterable getElementNameProposals(String namespace, Filter<String> filter, boolean recurseChildren) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getElementNames(namespace, recurseChildren), filter));
- }
-
- public abstract Iterable<String> getElementNames(String namespace, boolean recurseChildren);
-
- public enum Kind {
-
- /**
- * An {@link XsdTypeDefinition} of SIMPLE {@link Kind} may safely be cast to an {@link XsdSimpleTypeDefinition}
- */
- SIMPLE,
-
- /**
- * An {@link XsdTypeDefinition} of COMPLEX {@link Kind} may safely be cast to an {@link XsdComplexTypeDefinition}
- */
- COMPLEX;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
deleted file mode 100644
index af5191d2a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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:
- * IBM Corporation - initial API and implementation
- * (copied mainly from org.eclipse.wst.xsd.contentmodel.internal.XSDImpl)
- * Oracle - extensions and modifications
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xsd.contentmodel.internal.util.XSDSchemaLocatorAdapterFactory;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSwitch;
-
-/**
- * Utility class for building XSD model and its extensions for JAXB
- */
-public class XsdUtil {
-
- static final XsdAdapterFactoryImpl adapterFactory = new XsdAdapterFactoryImpl();
-
-
- public static boolean namespaceEquals(XSDNamedComponent comp, String namespace) {
- String xsdNamespace = comp.getTargetNamespace();
- return (xsdNamespace == null) ? StringTools.stringIsEmpty(namespace) : xsdNamespace.equals(namespace);
- }
-
- public static String getResolvedUri(String location) {
- String resolvedUri = null;
-
- ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-
- if (! StringTools.stringIsEmpty(location)) {
- try {
- resolvedUri = catalog.resolveSystem(location);
- if (resolvedUri == null) {
- resolvedUri = catalog.resolveURI(location);
- }
- if (resolvedUri == null) {
- resolvedUri = catalog.resolvePublic(location, null);
- }
- }
- catch (MalformedURLException me) {
- JptJaxbCorePlugin.log(me);
- resolvedUri = null;
- }
- catch (IOException ie) {
- JptJaxbCorePlugin.log(ie);
- resolvedUri = null;
- }
- }
-
- // if resolvedUri is null, assume the location is resolved
- return (resolvedUri != null) ? resolvedUri : location;
- }
-
-
- public static XsdSchema getSchema(XSDSchema xsdSchema) {
- return (xsdSchema == null) ? null : (XsdSchema) XsdUtil.getAdapter(xsdSchema);
- }
-
- public static XsdSchema getSchemaForSchema() {
- return getSchema(XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001));
- }
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding EMF object.
- */
- public static XSDSchema buildXSDModel(String uriString) {
- XSDSchema xsdSchema = null;
-
- // if XML Schema for Schema is requested, get it through schema model
- if (uriString.endsWith("2001/XMLSchema.xsd")) {
- xsdSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- }
- else {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
-
- URI uri = URI.createURI(uriString);
-
- // CS : bug 113537 ensure we perform physical resolution before opening a stream for the resource
- String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", uriString);
- XSDResourceImpl resource = null;
- try {
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
- resource = (XSDResourceImpl) resourceSet.createResource(URI.createURI("*.xsd"));
- resource.setURI(uri);
- resource.load(inputStream, null);
- }
- catch (IOException e) {
- // schema does not exist or cannot be read
- // swallow the exception, and return null
- // there will be project validation to capture this error
- return null;
- }
- xsdSchema = resource.getSchema();
- }
- handleImports(xsdSchema);
- return xsdSchema;
- }
-
- private static void handleImports(XSDSchema xsdSchema) {
- if (xsdSchema != null) {
- for (XSDSchemaContent content : xsdSchema.getContents()) {
- if (content instanceof XSDImportImpl) {
- XSDImportImpl anImport = (XSDImportImpl) content;
- try {
- if (anImport.getSchemaLocation() != null) {
- anImport.importSchema();
- }
- }
- catch (Exception e) {
- JptJaxbCorePlugin.log(e);
- }
- }
- }
- }
- }
-
- public static Object getAdapter(Notifier notifier) {
- return adapterFactory.adapt(notifier);
- }
-
-
- /**
- * The Factory for the XSD adapter model. It provides a create method for each
- * non-abstract class of the model.
- */
- public static class XsdAdapterFactoryImpl
- extends AdapterFactoryImpl {
-
- @Override
- public Adapter createAdapter(Notifier target) {
- XSDSwitch xsdSwitch = new XSDSwitch() {
- @Override
- public Object caseXSDSchema(XSDSchema object) {
- return new XsdSchema(object);
- }
-
- @Override
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
- return new XsdAttributeDeclaration(object);
- }
-
- @Override
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
- return new XsdAttributeGroupDefinition(object);
- }
-
- @Override
- public Object caseXSDAttributeUse(XSDAttributeUse object) {
- return new XsdAttributeUse(object);
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- return new XsdComplexTypeDefinition(object);
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- return new XsdElementDeclaration(object);
- }
-
- @Override
- public Object caseXSDModelGroup(XSDModelGroup object) {
- return new XsdModelGroup(object);
- }
-
- @Override
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
- return new XsdModelGroupDefinition(object);
- }
-
- @Override
- public Object caseXSDParticle(XSDParticle object) {
- return new XsdParticle(object);
- }
-
- @Override
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- return new XsdSimpleTypeDefinition(object);
- }
- };
-
- Object o = xsdSwitch.doSwitch((EObject) target);
- Adapter result = null;
- if (o instanceof Adapter) {
- result = (Adapter) o;
- }
- return result;
- }
-
- public Adapter adapt(Notifier target) {
- return adapt(target, this);
- }
- }
-}

Back to the top