Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jaxb/plugins')
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java241
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gifbin587 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gifbin574 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gifbin351 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gifbin1834 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java156
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java111
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java275
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java186
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java216
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java355
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java142
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java38
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java195
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java287
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml298
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties22
-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/AnnotationProvider.java79
-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.java1038
-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.java147
-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.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java373
-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.java464
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContainmentMapping.java93
-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.java130
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java75
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java112
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentClass.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentField.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentProperty.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRegistry.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTransientClass.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java110
-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.java59
-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.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java30
-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.java52
-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.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java41
-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/XmlRootElement.java84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java49
-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.java182
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java498
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java149
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java1602
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java128
-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/JavaPackageInfoResourceModelProvider.java57
-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/JaxbPlatformTester.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java122
-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.java87
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java623
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java132
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java126
-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/AbstractJavaPersistentType.java431
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java130
-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.java652
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMapping.java604
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMappingXmlSchemaType.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java188
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java87
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java373
-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.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java392
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java780
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java131
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentField.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentProperty.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java144
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java236
-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/GenericJavaXmlAdaptable.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java228
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java223
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java209
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java90
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java111
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java238
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java287
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java196
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java101
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java105
-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.java65
-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.java277
-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.java20
-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.java264
-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.java173
-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.java287
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/AbstractJaxb_2_1_PlatformDefinition.java144
-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.java42
-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/AbstractJaxb_2_2_PlatformDefinition.java20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java44
-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/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.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java135
-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.java133
-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/resource/java/NullAnnotation.java78
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java134
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java137
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java144
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java60
-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.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java62
-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.java61
-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.java71
-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.java61
-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.java64
-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.java61
-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/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/BinaryAnnotation.java93
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java107
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java125
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java210
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java209
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java132
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java151
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java80
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java111
-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.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java212
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAbstractType.java194
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java500
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java175
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java321
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java176
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnum.java220
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnumConstant.java83
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceField.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java162
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMethod.java154
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java333
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java97
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java119
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java488
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java174
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java172
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java185
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java362
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java313
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java253
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java223
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java125
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java246
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java98
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java151
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java303
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java272
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java168
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java322
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java124
-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.java94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java66
-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/Annotation.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java174
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAbstractType.java120
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java143
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnum.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnumConstant.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceField.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMethod.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java93
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbContainmentAnnotation.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotationDefinition.java54
-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.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java52
-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.java86
-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.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java162
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java67
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java53
-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.java100
-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.java52
-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.java70
-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.java82
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java84
-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.java175
-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/xsd/XsdAdapter.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java202
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java194
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties17
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties20
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink-src.zipbin5194269 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink.jarbin5697505 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java290
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gifbin364 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gifbin220 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gifbin612 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gifbin598 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gifbin574 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gifbin351 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gifbin124 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gifbin220 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gifbin911 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gifbin227 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_class.gifbin1005 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gifbin981 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gifbin124 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gifbin193 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/registry.gifbin1005 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/transient_class.gifbin1007 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gifbin901 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gifbin900 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gifbin883 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gifbin881 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gifbin886 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gifbin880 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gifbin3162 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gifbin2787 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gifbin3213 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml303
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties167
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd139
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java185
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java181
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java78
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemLabelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemLabelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTransientClassItemLabelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java232
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java138
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java133
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java312
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java912
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java246
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java186
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java805
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java358
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java643
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java190
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java185
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java195
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java178
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java90
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java856
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java204
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java267
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java439
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java35
554 files changed, 0 insertions, 52295 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project
deleted file mode 100644
index de731ab893..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index c6c16f392a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/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>June 06, 2007</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> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini
deleted file mode 100644
index 6c107d466d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +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
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties
deleted file mode 100644
index 7ed9bf2fc2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink DBWS Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties
deleted file mode 100644
index 6c20e3b027..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,17 +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
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml
deleted file mode 100644
index 434ae90d00..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.dbws.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.dbws.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.dbws.eclipselink.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties
deleted file mode 100644
index cdf657e329..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink DBWS Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath
deleted file mode 100644
index ad32c83a78..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project
deleted file mode 100644
index 4c657b1ec5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.core.gen</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.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index 8e395f6bac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.core.gen;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.eclipse.persistence.dbws.builder;bundle-version="[2.3.0,3.0.0)",
- javax.wsdl;bundle-version="[1.6.2,2.0.0)"
-Export-Package: org.eclipse.jpt.dbws.eclipselink.core.gen
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/about.html
+++ /dev/null
@@ -1,47 +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">
-
-<H2>About This Content</H2>
-
-<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>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties
deleted file mode 100644
index a00641b71c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/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
-###############################################################################
-javacSource=1.6
-javacTarget=1.6
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties
deleted file mode 100644
index 5d537fcf12..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - DBWS Support - Web Services Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java
deleted file mode 100644
index 4f6f4451a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/Main.java
+++ /dev/null
@@ -1,241 +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.dbws.eclipselink.core.gen;
-
-import static java.util.logging.Level.INFO;
-import static java.util.logging.Level.SEVERE;
-import static org.eclipse.persistence.tools.dbws.DBWSPackager.ArchiveUse.ignore;
-
-import java.io.File;
-import java.util.logging.Level;
-
-import javax.wsdl.WSDLException;
-
-import org.eclipse.jpt.dbws.eclipselink.core.gen.internal.JptDbwsCoreMessages;
-import org.eclipse.jpt.dbws.eclipselink.core.gen.internal.Tools;
-import org.eclipse.persistence.oxm.XMLContext;
-import org.eclipse.persistence.oxm.XMLUnmarshaller;
-import org.eclipse.persistence.tools.dbws.DBWSBuilder;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModel;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModelProject;
-import org.eclipse.persistence.tools.dbws.DBWSPackager;
-import org.eclipse.persistence.tools.dbws.EclipsePackager;
-
-/**
- * Generate DBWS content
- *
- * Current command-line arguments:
- * [-builderFile dbws-builder.xml] - specifies source builder file
- * [-stageDir .\Output_Dir] - specifies destination directory
- * [-packageAs eclipse] - specifies the source package
- */
-public class Main
-{
- private String builderFile;
- private String stageDir;
- private String packageAs;
- @SuppressWarnings("unused")
- private boolean isDebugMode;
-
- // ********** static methods **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- // ********** constructors **********
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
-
- this.initializeWith(args);
-
- this.generate();
- }
-
- private void generate() {
-
- DBWSBuilder builder = new DBWSBuilder();
-
- DBWSBuilderModel model = this.buildBuilderModel(this.builderFile);
- if(model == null) {
- this.logMessage(INFO, JptDbwsCoreMessages.NO_GENERATION_PERFORMED);
- return;
- }
-
- builder.setProperties(model.properties);
- builder.setOperations(model.operations);
-
- if( ! this.jdbcDriverIsOnClasspath(builder.getDriver())) {
- return;
- }
-
- DBWSPackager packager = this.buildEclipsePackager();
-
- this.initializePackager(packager, builder, this.buildStageDir(this.stageDir));
- builder.setPackager(packager);
-
- try {
- builder.start();
- }
- catch(WSDLException e) {
- this.logMessage(SEVERE, JptDbwsCoreMessages.WSDL_EXCEPTION, e.getMessage());
- return;
- }
- catch(Exception e) {
- //TODO Clean-up Stage dir. ?
- this.logMessage(SEVERE, JptDbwsCoreMessages.GENERATION_FAILED, e.getMessage());
- e.printStackTrace();
- return;
- }
- this.logMessage(INFO, JptDbwsCoreMessages.GENERATION_COMPLETED);
- return;
-
- }
-
- // ********** internal methods **********
-
- private void initializeWith(String[] args) {
-
- this.builderFile = this.getArgumentBuilderFile(args);
- this.stageDir = this.getArgumentStageDir(args);
- this.packageAs = this.getArgumentPackageAs(args);
-
- this.isDebugMode = this.getArgumentDebugMode(args);
- }
-
- private void initializePackager(DBWSPackager packager, DBWSBuilder builder, File stageDir) {
-
- packager.setDBWSBuilder(builder);
- packager.setArchiveUse(ignore);
- packager.setAdditionalArgs(null);
- packager.setStageDir(stageDir);
- packager.setSessionsFileName(builder.getSessionsFileName());
- }
-
- private DBWSBuilderModel buildBuilderModel(String builderFileName) {
-
- File builderFile = this.getBuilderFile(builderFileName);
- return this.unmarshal(builderFile);
- }
-
- private DBWSBuilderModel unmarshal(File builderFile) {
- if((builderFile == null) || ( ! builderFile.exists())) {
- return null;
- }
- XMLContext context = new XMLContext(new DBWSBuilderModelProject());
- XMLUnmarshaller unmarshaller = context.createUnmarshaller();
-
- DBWSBuilderModel model = (DBWSBuilderModel)unmarshaller.unmarshal(builderFile);
- if(model.properties.size() == 0) {
- this.logMessage(SEVERE, JptDbwsCoreMessages.NO_OPERATIONS_SPECIFIED);
- return null;
- }
- return model;
- }
-
- private File getBuilderFile(String builderFileName) {
-
- File builderFile = new File(builderFileName);
- if( ! (builderFile.exists() && builderFile.isFile())) {
- this.logMessage(SEVERE,
- JptDbwsCoreMessages.UNABLE_TO_LOCATE_BUILDER_XML, builderFileName); //$NON-NLS-1$
- return null;
- }
- return builderFile;
- }
-
- private File buildStageDir(String stageDirName) {
- File dir = new File(stageDirName);
- if(( ! dir.exists()) || ( ! dir.isDirectory())) {
- dir = Tools.buildDirectory(stageDirName);
- }
- return dir;
- }
-
- private EclipsePackager buildEclipsePackager() {
- return new EclipsePackager() {
- @Override
- public void start() {
- // no need to check for the existence of stageDir, everything is in-memory
- }
- };
- }
-
- private boolean jdbcDriverIsOnClasspath(String jdbcDriverName) {
- try {
- Class.forName(jdbcDriverName);
- }
- catch (ClassNotFoundException cnfe) {
- this.logMessage(SEVERE, JptDbwsCoreMessages.DRIVER_NOT_ON_CLASSPATH, jdbcDriverName);
- return false;
- }
- return true;
- }
-
- private void logMessage(Level level, String key, Object argument) {
- Tools.logMessage(level, Tools.bind(key, argument));
- }
-
- private void logMessage(Level level, String key) {
- Tools.logMessage(level, Tools.getString(key));
- }
-
- // ********** argument queries **********
-
- private String getArgumentBuilderFile(String[] args) {
-
- return this.getArgumentValue("-builderFile", args); //$NON-NLS-1$
- }
-
- private String getArgumentStageDir(String[] args) {
-
- return this.getArgumentValue("-stageDir", args); //$NON-NLS-1$
- }
-
- private String getArgumentPackageAs(String[] args) {
-
- return this.getArgumentValue("-packageAs", args); //$NON-NLS-1$
- }
-
- private boolean getArgumentDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- private String getArgumentValue(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private boolean argumentExists(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java
deleted file mode 100644
index ff3fa9b9fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/JptDbwsCoreMessages.java
+++ /dev/null
@@ -1,44 +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.dbws.eclipselink.core.gen.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localized messages used by Dali DBWS generation core.
- */
-public class JptDbwsCoreMessages
-{
-
- public static final String GENERATION_COMPLETED = "GENERATION_COMPLETED";
- public static final String GENERATION_FAILED = "GENERATION_FAILED";
- public static final String NO_GENERATION_PERFORMED = "NO_GENERATION_PERFORMED";
- public static final String WSDL_EXCEPTION = "WSDL_EXCEPTION";
- public static final String NO_OPERATIONS_SPECIFIED = "NO_OPERATIONS_SPECIFIED";
- public static final String UNABLE_TO_LOCATE_BUILDER_XML = "UNABLE_TO_LOCATE_BUILDER_XML";
- public static final String DRIVER_NOT_ON_CLASSPATH = "DRIVER_NOT_ON_CLASSPATH";
-
-
- private static final String BUNDLE_NAME = "org.eclipse.jpt.dbws.eclipselink.core.gen.internal.jpt_dbws_core"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private JptDbwsCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java
deleted file mode 100644
index 7a49d7aaae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/Tools.java
+++ /dev/null
@@ -1,110 +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.dbws.eclipselink.core.gen.internal;
-
-import static java.util.logging.Level.SEVERE;
-
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.logging.Level;
-
-/**
- * Tools
- */
-public final class Tools
-{
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- private static final String USER_DIRECTORY = System.getProperty("user.dir"); //$NON-NLS-1$
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if (string == null) {
- return true;
- }
- int len = string.length();
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string.toCharArray(), len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- // ********** short name manipulation **********
-
-
- public static File buildDirectory(String dirName) {
- File currentDir = currentWorkingDirectory();
- File dir = new File(currentDir, dirName);
- dir.mkdir();
- return dir;
- }
-
- /**
- * Return a file representing the current working directory.
- */
- public static File currentWorkingDirectory() {
- return new File(USER_DIRECTORY); //$NON-NLS-1$
- }
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- public static String extractDirectory(String path) {
- if( ! path.contains(File.separator)) {
- return EMPTY_STRING;
- }
- return path.substring(0, path.lastIndexOf(File.separator));
- }
-
- public static void logMessage(Level level, String message) {
- if(level == SEVERE) {
- System.err.println('\n' + message);
- }
- else {
- System.out.println('\n' + message);
- }
- }
-
- // ********** NLS utilities **********
-
- public static String getString(String key) {
- return JptDbwsCoreMessages.getString(key);
- }
-
- public static String bind(String key, Object argument) {
- return MessageFormat.format(getString(key), argument);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties
deleted file mode 100644
index c49d70feb4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/src/org/eclipse/jpt/dbws/eclipselink/core/gen/internal/jpt_dbws_core.properties
+++ /dev/null
@@ -1,17 +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
-################################################################################
-
-GENERATION_COMPLETED = DBWSBuilder generation completed
-GENERATION_FAILED = DBWSBuilder generation failed: {0}
-NO_GENERATION_PERFORMED = DBWSBuilder no generation performed
-WSDL_EXCEPTION = WSDLException: {0}
-NO_OPERATIONS_SPECIFIED = No operations specified
-UNABLE_TO_LOCATE_BUILDER_XML = DBWSBuilder unable to locate builder XML file: {0}
-DRIVER_NOT_ON_CLASSPATH = JDBC driver not on classpath: {0}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
deleted file mode 100644
index 958e1de112..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
+++ /dev/null
@@ -1,8 +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/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project
deleted file mode 100644
index 7d3b57f9f6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.ui</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.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 76e5cf8f44..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Jan 03 02:49:56 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.compliance=1.5
-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.dbws.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index e39cd76e36..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.dbws.eclipselink.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.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.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.dbws.eclipselink.core.gen;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.persistence.core;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.persistence.dbws.builder;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,2.0.0)"
-Export-Package: org.eclipse.jpt.dbws.eclipselink.core.internal.gen;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui,
- org.eclipse.jpt.dbws.eclipselink.ui.internal;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui.internal.actions;x-internal:=true,
- org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/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.dbws.eclipselink.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
deleted file mode 100644
index 0ed30c451a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
+++ /dev/null
@@ -1,20 +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
-################################################################################
-javacSource = 1.6
-javacTarget = 1.6
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml
deleted file mode 100644
index 4bf2db832f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.dbws.eclipselink.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.dbws.eclipselink.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif
deleted file mode 100644
index 1ee05fa2e5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif
deleted file mode 100644
index cc0eeb7196..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif
deleted file mode 100644
index 3c0acadd2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif
deleted file mode 100644
index 77c16a0f87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties
deleted file mode 100644
index efab1b2e17..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.properties
+++ /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
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - DBWS UI
-providerName=Eclipse Web Tools Platform
-
-generateDBWS = Generate Database Web Services
-
-dbwsWizardCategoryName = Database Web Services
-
-generateDbwsFromXmlName = Web Services from Builder XML
-generateDbwsFromXmlDesc = Generate Web Services from Builder XML
-
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
deleted file mode 100644
index 5c52d864fe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- 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
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions for any popup -->
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any">
-
- <menu
- id="org.eclipse.jpt.dbws.ui.menu.WebServices"
- label="%dbwsWizardCategoryName">
- </menu>
- </menuContribution>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.dbws"
- name="%dbwsWizardCategoryName"/>
-
- <wizard
- id="org.eclipse.jpt.dbws.ui.wizard.generateDbws"
- name="%generateDbwsFromXmlName"
- category="org.eclipse.jpt.dbws"
- class="org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen.DbwsGeneratorWizard"
- icon="icons/full/etool16/newclient_webserv_wiz.gif">
- <description>%generateDbwsFromXmlDesc</description>
- </wizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <!-- contributions to the "Generate" submenu -->
- <objectContribution
- id="org.eclipse.jpt.ui.xsdFileActions"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*builder.xml">
-
- <filter
- name="projectNature"
- value="org.eclipse.jdt.core.javanature">
- </filter>
- <enablement>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.web"/>
- </enablement>
- <action
- id="org.eclipse.jpt.dbws.ui.generateDbws"
- label="%generateDBWS"
- menubarPath="org.eclipse.jpt.dbws.ui.menu.WebServices/content"
- class="org.eclipse.jpt.dbws.eclipselink.ui.internal.actions.GenerateDbwsAction">
- </action>
- </objectContribution>
-
- </extension>
-
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties
deleted file mode 100644
index 0d62c677d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/property_files/jpt_dbws_ui.properties
+++ /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
-################################################################################
-
-
-# DbwsGenerator
-DbwsGeneratorWizard_title = New Database Web Services from Builder XML
-DbwsGeneratorWizard_generatingDbws = Generating Database Web Services
-
-WebDynamicProjectWizardPage_title = Web Dynamic Project
-WebDynamicProjectWizardPage_desc = Specify project for Database Web Services
-WebDynamicProjectWizardPage_destinationProject = Select destination project:
-
-BuilderXmlWizardPage_title = Select Builder XML File
-BuilderXmlWizardPage_desc = Specify XML file to generate Database Web Services from
-
-BuilderXmlWizardPage_errorUriCannotBeLocated = The selected catalog entry specifies a URI that can not be located.
-
-JdbcDriverWizardPage_title = Driver files
-JdbcDriverWizardPage_desc = Specify driver JAR files
-
-JdbcDriverWizardPage_driverFiles = Driver files:
-
-JdbcDriverWizardPage_addButton = Add...
-JdbcDriverWizardPage_removeButton = Remove
-
-JdbcDriverWizardPage_chooseADriverFile = Driver File Selection
-
-DbwsGeneratorUi_runningDbwsWarningTitle = Generating Database Web Services
-DbwsGeneratorUi_runningDbwsWarningMessage = \
- Warning: Running DBWS Builder will overwrite existing files in your project.\
- \n\nAre you sure you want to continue?
-
-DbwsGeneratorUi_dbwsNotOnClasspathMessage = \
- Warning: DBWS Builder is not on your project classpath.\
- \n\nAre you sure you want to continue?
-
-DbwsGeneratorUi_notJavaProject = Not a java project
-DbwsGeneratorUi_notWebDynamicProject = Not a WebDynamic project
-
-BuilderXmlWizardPage_xmlCatalogTableTitle = XML Catalog
-BuilderXmlWizardPage_xmlCatalogKeyColumn = Key
-BuilderXmlWizardPage_xmlCatalogUriColumn = URI \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java
deleted file mode 100644
index 16c1e6c586..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java
+++ /dev/null
@@ -1,156 +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.dbws.eclipselink.core.internal.gen;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * DbwsGenerator
- */
-public class DbwsGenerator extends AbstractJptGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "DBWS Gen Run Config"; //$NON-NLS-1$
- static public String DBWS_GEN_PACKAGE_NAME = "org.eclipse.jpt.dbws.eclipselink.core.gen"; //$NON-NLS-1$
- static public String DBWS_GEN_CLASS = DBWS_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
-
- static public String DBWS_GEN_JAR_PREFIX = DBWS_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
-
- private final String builderFileName;
- private final String stageDirName;
- private final String driverJarList;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String builderFileName,
- String stageDirName,
- String driverJarList,
- IProgressMonitor monitor) {
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new DbwsGenerator(javaProject,
- builderFileName,
- stageDirName,
- driverJarList).generate(monitor);
- }
-
- // ********** constructors **********
-
- private DbwsGenerator(
- IJavaProject javaProject,
- String builderFileName,
- String stageDirName,
- String driverJarList) {
- super(javaProject);
- this.builderFileName = builderFileName;
- this.stageDirName = stageDirName;
- this.driverJarList = driverJarList;
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return DBWS_GEN_CLASS;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return DBWS_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // do nothing
-
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- try {
- this.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // DBWS_Gen jar
- classpath.add(this.getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // JDBC jar
- if( ! StringTools.stringIsEmpty(this.driverJarList)) {
- classpath.add(this.getJdbcJarClasspathEntry().getMemento());
- }
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
-
- StringBuffer programArguments = new StringBuffer();
-
- // builderFile
- programArguments.append(" -builderFile \""); //$NON-NLS-1$
- programArguments.append(this.builderFileName);
- programArguments.append('"');
-
- // stageDir
- programArguments.append(" -stageDir \""); //$NON-NLS-1$
- programArguments.append(this.stageDirName);
- programArguments.append('"');
-
- // packageAs
- programArguments.append(" -packageAs eclipse"); //$NON-NLS-1$
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** private methods **********
-
- private IRuntimeClasspathEntry getJdbcJarClasspathEntry() {
- return getArchiveClasspathEntry(this.buildJdbcJarPath());
- }
-
- private IPath buildJdbcJarPath() {
- return new Path(this.driverJarList);
- }
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java
deleted file mode 100644
index 25b0f74546..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsUiPlugin.java
+++ /dev/null
@@ -1,111 +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.dbws.eclipselink.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * 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.
- */
-@SuppressWarnings("nls")
-public class JptDbwsUiPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.dbws.eclipselink.ui"; //$NON-NLS-1$
-
- public static final String USER_CATALOG_ID = XMLCorePlugin.USER_CATALOG_ID; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = XMLCorePlugin.DEFAULT_CATALOG_ID; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = XMLCorePlugin.SYSTEM_CATALOG_ID; //$NON-NLS-1$
-
- // ********** singleton **********
- private static JptDbwsUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptDbwsUiPlugin instance() {
- return INSTANCE;
- }
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- // ********** XMLCorePlugin API **********
-
- public ICatalog getDefaultXMLCatalog() {
- return XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- }
-
-
- // ********** constructors **********
-
- public JptDbwsUiPlugin() {
- super();
- if(INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
deleted file mode 100644
index 8000bf3b6c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/DbwsGeneratorUi.java
+++ /dev/null
@@ -1,275 +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.dbws.eclipselink.ui.internal;
-
-import java.io.File;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.dbws.eclipselink.core.internal.gen.DbwsGenerator;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen.DbwsGeneratorWizard;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.persistence.oxm.XMLContext;
-import org.eclipse.persistence.oxm.XMLUnmarshaller;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModel;
-import org.eclipse.persistence.tools.dbws.DBWSBuilderModelProject;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * DbwsGeneratorUi
- */
-public class DbwsGeneratorUi
-{
- private final IJavaProject javaProject;
- private final String builderXmlFile;
-
- private static final String WEB_FACET_ID = "jst.web"; //$NON-NLS-1$
- private static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$
- private static final String DBWS_BUILDER_CLASS_NAME = "org.eclipse.persistence.tools.dbws.DBWSBuilder"; //$NON-NLS-1$
-
- // ********** static methods **********
-
- public static void generate(IFile xmlFile) {
- IProject project = xmlFile.getProject();
-
- if( ! projectIsWebDynamic(project)) {
- throw new RuntimeException(JptDbwsUiMessages.DbwsGeneratorUi_notWebDynamicProject);
- }
- IPath xmlPath = xmlFile.getProjectRelativePath();
-
- new DbwsGeneratorUi(project, xmlPath.toOSString()).generate();
- }
-
- public static boolean projectIsWebDynamic(IProject project) {
-
- IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(WEB_FACET_ID);
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(project);
- }
- catch (CoreException e) {
- return false;
- }
- return (facetedProject == null) ? false : facetedProject.hasProjectFacet(projectFacet);
- }
-
- public static IPath getWebContentPath(IProject project){
- IVirtualComponent component = ComponentCore.createComponent(project);
- IPath modulePath = component.getRootFolder().getProjectRelativePath();
- return modulePath;
- }
-
- public static boolean displayDBWSNotOnClasspathWarning(Shell shell) {
-
- String msg = JptDbwsUiMessages.DbwsGeneratorUi_dbwsNotOnClasspathMessage;
-
- return MessageDialog.openQuestion(
- shell,
- JptDbwsUiMessages.DbwsGeneratorUi_runningDbwsWarningTitle,
- msg);
- }
-
- public static boolean displayOverridingWebContentWarning(Shell shell) {
-
- String msg = JptDbwsUiMessages.DbwsGeneratorUi_runningDbwsWarningMessage;
-
- return MessageDialog.openQuestion(
- shell,
- JptDbwsUiMessages.DbwsGeneratorUi_runningDbwsWarningTitle,
- msg);
- }
-
- // ********** constructors **********
-
- private DbwsGeneratorUi(IProject webProject, String builderXmlFile) {
- super();
- if(webProject == null || StringTools.stringIsEmpty(builderXmlFile)) {
- throw new NullPointerException();
- }
- this.javaProject = this.getJavaProjectFrom(webProject);
- if(this.javaProject == null) {
- throw new RuntimeException(JptDbwsUiMessages.DbwsGeneratorUi_notJavaProject);
- }
- this.builderXmlFile = builderXmlFile;
- }
-
- // ********** generate **********
- /**
- * prompt the user with a wizard
- */
- protected void generate() {
-
- if( ! this.dbwsIsOnClasspath()) {
- if( ! displayDBWSNotOnClasspathWarning(this.getCurrentShell())) {
- return;
- }
- }
- if(this.classIsOnProjectsClasspath(
- this.getDriverNameFrom(this.builderXmlFile))) {
-
- if(displayOverridingWebContentWarning(this.getCurrentShell())) {
- this.scheduleGenerateDbwsJob();
- }
- return;
- }
- this.openWizardDialog();
- return;
- }
-
- // ********** internal methods **********
-
- private void openWizardDialog() {
-
- DbwsGeneratorWizard wizard = new DbwsGeneratorWizard(this.javaProject, this.builderXmlFile);
- wizard.setWindowTitle(JptDbwsUiMessages.DbwsGeneratorWizard_title);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if(returnCode != Window.OK) {
- return;
- }
- }
-
- private String getDriverNameFrom(String builderXmlFile) {
- try {
- DBWSBuilderModel model = this.buildBuilderModel(builderXmlFile);
- Map<String, String> properties = model.getProperties();
- return properties.get(DRIVER_PROPERTY);
- }
- catch(Exception e) {
- return null;
- }
- }
-
- private DBWSBuilderModel buildBuilderModel(String builderFileName) {
- String projectDirName = this.javaProject.getProject().getLocation().toOSString();
- File builderFile = this.getBuilderFile(projectDirName + File.separator + builderFileName);
- return this.unmarshal(builderFile);
- }
-
- private DBWSBuilderModel unmarshal(File builderFile) {
- if((builderFile == null) || ( ! builderFile.exists())) {
- return null;
- }
- XMLContext context = new XMLContext(new DBWSBuilderModelProject());
- XMLUnmarshaller unmarshaller = context.createUnmarshaller();
-
- DBWSBuilderModel model = (DBWSBuilderModel)unmarshaller.unmarshal(builderFile);
- if(model == null || model.properties.size() == 0) {
- return null;
- }
- return model;
- }
-
- private File getBuilderFile(String builderFileName) {
-
- File builderFile = new File(builderFileName);
- if( ! (builderFile.exists() && builderFile.isFile())) {
- return null;
- }
- return builderFile;
- }
-
- /**
- * Test if the given class is on the project's classpath.
- */
- private boolean classIsOnProjectsClasspath(String driverName) {
- try {
- if(StringTools.stringIsEmpty(driverName)) {
- return false;
- }
- IType genClass = this.javaProject.findType(driverName);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the DBWS builder is on the project's classpath.
- */
- private boolean dbwsIsOnClasspath() {
- try {
- IType genClass = this.javaProject.findType(DBWS_BUILDER_CLASS_NAME);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- private IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- private void scheduleGenerateDbwsJob() {
-
- String stageDirName = this.javaProject.getProject().getLocation().toOSString();
-
- WorkspaceJob generateJob = new GenerateDbwsJob(
- this.javaProject,
- this.builderXmlFile,
- stageDirName,
- null // driverJarList
- );
- generateJob.schedule();
- }
-
- // ********** generate DBWS job **********
-
- public static class GenerateDbwsJob extends WorkspaceJob {
- private final IJavaProject project;
- final String builderFileName;
- final String stageDirName;
- final String driverJarList;
-
- public GenerateDbwsJob(IJavaProject project, String builderFileName, String stageDirName, String driverJarList) {
- super(JptDbwsUiMessages.DbwsGeneratorWizard_generatingDbws);
-
- this.project = project ;
- this.builderFileName = builderFileName;
- this.stageDirName = stageDirName;
- this.driverJarList = driverJarList;
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- DbwsGenerator.generate(this.project, this.builderFileName, this.stageDirName, this.driverJarList, monitor);
- return Status.OK_STATUS;
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java
deleted file mode 100644
index 38beda8da7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java
+++ /dev/null
@@ -1,18 +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.dbws.eclipselink.ui.internal;
-
-@SuppressWarnings("nls")
-public class JptDbwsUiIcons
-{
- // **************** Wizard icons *******************************************
-
- public static final String DBWS_GEN_WIZ_BANNER = "full/wizban/webservicesclient_wiz";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java
deleted file mode 100644
index 1610eac2a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiMessages.java
+++ /dev/null
@@ -1,68 +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.dbws.eclipselink.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali DBWS UI.
- *
- * @version 2.3
- */
-public class JptDbwsUiMessages {
-
- // DbwsGenerator
- public static String DbwsGeneratorWizard_title;
- public static String DbwsGeneratorWizard_generatingDbws;
-
- public static String WebDynamicProjectWizardPage_title;
- public static String WebDynamicProjectWizardPage_desc;
- public static String WebDynamicProjectWizardPage_destinationProject;
-
- public static String BuilderXmlWizardPage_title;
- public static String BuilderXmlWizardPage_desc;
-
- public static String BuilderXmlWizardPage_errorUriCannotBeLocated;
-
- public static String JdbcDriverWizardPage_title;
- public static String JdbcDriverWizardPage_desc;
-
- public static String JdbcDriverWizardPage_driverFiles;
-
- public static String JdbcDriverWizardPage_addButton;
- public static String JdbcDriverWizardPage_removeButton;
-
- public static String JdbcDriverWizardPage_chooseADriverFile;
-
- public static String DbwsGeneratorUi_runningDbwsWarningTitle;
- public static String DbwsGeneratorUi_runningDbwsWarningMessage;
- public static String DbwsGeneratorUi_dbwsNotOnClasspathMessage;
-
- public static String DbwsGeneratorUi_notJavaProject;
- public static String DbwsGeneratorUi_notWebDynamicProject;
-
- public static String BuilderXmlWizardPage_xmlCatalogTableTitle;
- public static String BuilderXmlWizardPage_xmlCatalogKeyColumn;
- public static String BuilderXmlWizardPage_xmlCatalogUriColumn;
-
-
-
-
- private static final String BUNDLE_NAME = "jpt_dbws_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptDbwsUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptDbwsUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.java
deleted file mode 100644
index 1dfee6b4b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/GenerateDbwsAction.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.dbws.eclipselink.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-
-/**
- * GenerateDbwsAction
- */
-public class GenerateDbwsAction extends ObjectAction
-{
-
- @Override
- protected void execute(IFile xmlFile) {
-
- DbwsGeneratorUi.generate(xmlFile);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.java
deleted file mode 100644
index 5c90f1e584..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/actions/ObjectAction.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.dbws.eclipselink.ui.internal.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * GenerateEntitiesAction
- */
-public abstract class ObjectAction extends ActionDelegate implements IObjectActionDelegate
-{
- private ISelection currentSelection;
-
- public ObjectAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- @Override
- public void run(IAction action) {
- if (this.currentSelection instanceof ITreeSelection) {
- for (Iterator<?> stream = ((ITreeSelection) this.currentSelection).iterator(); stream.hasNext(); ) {
- this.execute(stream.next());
- }
- }
- }
-
- protected void execute(Object selection) {
-
- if(selection instanceof IFile) {
- this.execute((IFile)selection);
- }
- }
-
- @SuppressWarnings("unused")
- protected void execute(IFile file) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
deleted file mode 100644
index 5eb23fc72e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
+++ /dev/null
@@ -1,186 +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.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-/**
- * BuilderXmlWizardPage
- */
-public class BuilderXmlWizardPage extends WizardPage {
-
- private final IStructuredSelection initialSelection;
- private IProject targetProject;
-
- protected SelectFileOrXMLCatalogIdPanel selectSourcePanel;
-
- protected static final String[] browseXMLFilterExtensions = {".xml"}; //$NON-NLS-1$
-
- // ********** static method **********
-
- public static IFile getBuilderXmlFromSelection(IStructuredSelection selection) {
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IFile) {
- String elementExtension = ((IFile)firstElement).getFileExtension();
- if(elementExtension != null) {
- if(browseXMLFilterExtensions[0].endsWith(elementExtension)) {
- return ((IFile)firstElement);
- }
- }
- }
- return null;
- }
-
- // ********** constructor **********
-
- BuilderXmlWizardPage(IStructuredSelection selection) {
- super("BuilderXmlWizardPage"); //$NON-NLS-1$
-
- this.initialSelection = selection;
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- this.setControl(composite);
-
- this.selectSourcePanel = new SelectFileOrXMLCatalogIdPanel(composite, this.initialSelection);
- this.selectSourcePanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SelectFileOrXMLCatalogIdPanel.PanelListener listener = new SelectFileOrXMLCatalogIdPanel.PanelListener() {
- public void completionStateChanged() {
- selectFileOrXMLCatalogIdPanelChanged();
- }
- };
- this.selectSourcePanel.setListener(listener);
- Dialog.applyDialogFont(parent);
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible) {
-
- if(this.getBuilderXml() != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.getBuilderXml()));
- }
- else {
- this.updateTargetProject();
- IFile schema = getBuilderXmlFromSelection(this.initialSelection);
- if(schema != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(schema));
- }
- else {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.targetProject));
- }
- }
- this.selectSourcePanel.update();
-
- this.setTitle(JptDbwsUiMessages.BuilderXmlWizardPage_title);
- this.setDescription(JptDbwsUiMessages.BuilderXmlWizardPage_desc);
- this.selectSourcePanel.setFilterExtensions(browseXMLFilterExtensions);
- }
- this.selectSourcePanel.setVisibleHelper(visible);
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
-
- return this.schemaOrUriSelected() && (this.getErrorMessage() == null);
- }
-
- // ********** intra-wizard methods **********
-
- public IFile getBuilderXml() {
- return this.selectSourcePanel.getFile();
- }
-
- public String getSourceURI() {
- String uri = this.selectSourcePanel.getXMLCatalogURI();
- if(uri == null) {
- IFile file = this.selectSourcePanel.getFile();
- if(file != null) {
- uri = URIHelper.getPlatformURI(file);
- }
- }
- return uri;
- }
-
- // ********** internal methods **********
-
- private void updateTargetProject() {
- IWizardPage previousPage = this.getPreviousPage();
-
- if(previousPage instanceof JavaProjectWizardPage) {
- // get project from previousPage
- this.targetProject = (((JavaProjectWizardPage)previousPage).getJavaProject()).getProject();
- }
- else if(initialSelection != null && ! this.initialSelection.isEmpty()) {
- // no previousPage - get project from initialSelection
- this.targetProject = this.getProjectFromInitialSelection();
- }
- }
-
- private IProject getProjectFromInitialSelection() {
- Object firstElement = initialSelection.getFirstElement();
- if(firstElement instanceof IProject) {
- return (IProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- return ((IResource) firstElement).getProject();
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject().getProject();
- }
- return null;
- }
-
- private boolean schemaOrUriSelected() {
- return ((this.getBuilderXml() != null) || (this.getSourceURI() != null));
- }
-
- private String computeErrorMessage() {
- String errorMessage = null;
- String uri = this.getSourceURI();
- if(uri != null) {
- if( ! URIHelper.isReadableURI(uri, false)) {
- errorMessage = JptDbwsUiMessages.BuilderXmlWizardPage_errorUriCannotBeLocated;
- }
- }
- return errorMessage;
- }
-
- private void selectFileOrXMLCatalogIdPanelChanged() {
- String errorMessage = this.computeErrorMessage();
- this.setErrorMessage(errorMessage);
- this.setPageComplete(this.isPageComplete());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
deleted file mode 100644
index a0c798a854..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
+++ /dev/null
@@ -1,216 +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.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * DbwsGeneratorWizard
- */
-public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
-
- private IJavaProject javaProject;
- private String builderXmlFile;
- private IStructuredSelection selection;
-
- private WebDynamicProjectWizardPage projectWizardPage;
- private BuilderXmlWizardPage builderXmlWizardPage;
-
- // Dialog store id constant
- private static final String WIZARD_NAME = DbwsGeneratorWizard.class.getName();
- private static final String DBWS_SECTION_NAME = "DbwsSettings"; //$NON-NLS-1$
-
- private JdbcDriverWizardPage jdbcDriversPage;
-
- // ********** constructor **********
-
- public DbwsGeneratorWizard() {
- super();
-
- this.initialize();
- }
-
- public DbwsGeneratorWizard(IJavaProject javaProject, String builderXmlFile) {
- super();
-
- this.javaProject = javaProject;
- this.builderXmlFile = builderXmlFile;
-
- this.initialize();
- }
-
- private void initialize() {
- if(this.getDialogSettings() == null) {
- IDialogSettings dbwsSettings = JptDbwsUiPlugin.instance().getDialogSettings();
- IDialogSettings wizardSettings = dbwsSettings.getSection(DBWS_SECTION_NAME);
- if(wizardSettings == null) {
- wizardSettings = dbwsSettings.addNewSection(DBWS_SECTION_NAME);
- }
- this.setDialogSettings(wizardSettings);
- }
- }
-
- // ********** IWorkbenchWizard implementation **********
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
-
- this.setWindowTitle(JptDbwsUiMessages.DbwsGeneratorWizard_title);
-
- this.setDefaultPageImageDescriptor(JptDbwsUiPlugin.getImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
- this.setNeedsProgressMonitor(true);
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- if(this.selection != null) {
- // WebDynamicProjectWizardPage
- this.javaProject = this.getJavaProjectFromSelection(this.selection);
-
- this.projectWizardPage = this.buildWebDynamicProjectPage(this.javaProject);
- this.addPage(this.projectWizardPage);
-
- // BuilderXmlWizardPage
- IFile builderXmlSelected = BuilderXmlWizardPage.getBuilderXmlFromSelection(this.selection);
- if(builderXmlSelected == null) {
- this.builderXmlWizardPage = this.buildBuilderXmlPage(this.selection);
- this.addPage(this.builderXmlWizardPage);
- }
- else {
- this.builderXmlFile = this.makeRelativeToProjectPath(builderXmlSelected.getFullPath());
- }
- }
- // JdbcDriverWizardPage
- this.jdbcDriversPage = this.buildJdbcDriversPage();
- this.addPage(this.jdbcDriversPage);
- }
-
- @Override
- public boolean performFinish() {
-
- WizardPage currentPage = (WizardPage)getContainer().getCurrentPage();
- if(currentPage != null) {
- if( ! currentPage.isPageComplete()) {
- return false;
- }
- }
-
- String driverJarList = this.jdbcDriversPage.getDriverJarList();
- this.jdbcDriversPage.finish(); // persist settings
-
- if(DbwsGeneratorUi.displayOverridingWebContentWarning(this.getShell())) {
- this.generateDbws(driverJarList);
- }
- return true;
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- if(this.projectWizardPage != null) {
- this.javaProject = this.projectWizardPage.getJavaProject();
- }
- return this.javaProject;
- }
-
- public String getBuilderXmlPathOrUri() {
- if(this.builderXmlWizardPage != null) {
- IFile xmlFile = this.builderXmlWizardPage.getBuilderXml();
- if(xmlFile != null) {
- return this.makeRelativeToProjectPath(xmlFile.getFullPath());
- }
- else {
- return this.builderXmlWizardPage.getSourceURI();
- }
- }
- return this.builderXmlFile;
- }
-
- // ********** internal methods **********
-
- private WebDynamicProjectWizardPage buildWebDynamicProjectPage(IJavaProject javaProject) {
-
- WebDynamicProjectWizardPage projectWizardPage = new WebDynamicProjectWizardPage(javaProject);
- projectWizardPage.setTitle(JptDbwsUiMessages.WebDynamicProjectWizardPage_title);
- projectWizardPage.setDescription(JptDbwsUiMessages.WebDynamicProjectWizardPage_desc);
- projectWizardPage.setDestinationLabel(JptDbwsUiMessages.WebDynamicProjectWizardPage_destinationProject);
-
- return projectWizardPage;
- }
-
- private BuilderXmlWizardPage buildBuilderXmlPage(IStructuredSelection selection) {
- return new BuilderXmlWizardPage(selection);
- }
-
- private JdbcDriverWizardPage buildJdbcDriversPage() {
- return new JdbcDriverWizardPage(WIZARD_NAME);
- }
-
- private String makeRelativeToProjectPath(IPath path) {
- IPath relativePath = path.makeRelativeTo(this.getJavaProject().getProject().getFullPath());
- return relativePath.toOSString();
- }
-
- private void generateDbws(String driverJarList) {
-
- String stageDirName = this.getJavaProject().getProject().getLocation().toOSString();
-
- WorkspaceJob generateJob = new DbwsGeneratorUi.GenerateDbwsJob(
- this.getJavaProject(),
- this.getBuilderXmlPathOrUri(),
- stageDirName,
- driverJarList
- );
- generateJob.schedule();
- }
-
- private IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
- return null;
- }
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IJavaProject) {
- return (IJavaProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- IProject project = ((IResource) firstElement).getProject();
- return getJavaProjectFrom(project);
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject();
- }
- return null;
- }
-
- private IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
deleted file mode 100644
index 8f5c9d1f07..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
+++ /dev/null
@@ -1,355 +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.dbws.eclipselink.ui.internal.wizards.gen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-/**
- * JdbcDriversWizardPage
- */
-public class JdbcDriverWizardPage extends WizardPage
-{
- private final String storedDriverClasspathId;
- private ArrayList<String> jarPaths;
-
- public static String BINDINGS_FILE_FILTER = "*.jar;*.zip"; //$NON-NLS-1$
- // dialog store id constants
- private static final String PAGE_ID = "DRIVER_CLASSPATH_ID"; //$NON-NLS-1$
- private static final String PATH_SEPARATOR = System.getProperty("path.separator"); //$NON-NLS-1$
-
- // ********** constructor **********
-
- protected JdbcDriverWizardPage(String wizardName) {
- super("Jdbc Driver"); //$NON-NLS-1$
-
- this.initialize();
-
- this.jarPaths = new ArrayList<String>();
- this.storedDriverClasspathId = wizardName + "." + PAGE_ID; //$NON-NLS-1$
- }
-
- protected void initialize() {
- this.setTitle(JptDbwsUiMessages.JdbcDriverWizardPage_title);
- this.setDescription(JptDbwsUiMessages.JdbcDriverWizardPage_desc);
- this.setImageDescriptor(JptDbwsUiPlugin.getImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
- }
-
- // ********** intra-wizard methods **********
-
- public void finish() {
- this.saveWidgetValues();
- }
-
- public String getDriverJarList() {
- return this.buildDriverJarListString();
- }
-
- // ********** internal methods **********
-
- /**
- * Initializes the JAR package from last used wizard page values.
- */
- private void initializeJarPaths() {
- IDialogSettings settings= this.getDialogSettings();
- if(settings != null) {
- // destination
- String[] driverPaths = settings.getArray(this.storedDriverClasspathId);
- if(driverPaths == null) {
- return; // ie.- no settings stored
- }
- this.jarPaths = new ArrayList<String>();
-
- CollectionTools.addAll(this.jarPaths, driverPaths);
- }
- }
-
- private void saveWidgetValues() {
- IDialogSettings settings= this.getDialogSettings();
-
- if(settings != null) {
- String[] driverPaths = this.jarPaths.toArray(new String[0]);
- settings.put(this.storedDriverClasspathId, driverPaths);
- }
- }
-
- private String buildDriverJarListString() {
- if(this.jarPaths.isEmpty()) {
- return StringTools.EMPTY_STRING;
- }
- StringBuffer result = new StringBuffer();
- for(String jar : this.jarPaths) {
- result.append(jar).append(PATH_SEPARATOR);
- }
- result.deleteCharAt(result.length() - 1); // remove last separator
- return result.toString();
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.initializeJarPaths();
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- new JarsGroup(composite);
-
- return composite;
- }
-
- // ********** private methods **********
-
- private void removeJarFile(String filePath) {
- this.jarPaths.remove(filePath);
- }
-
- private void addJarFile(String filePath) {
- if( ! this.jarPaths.contains(filePath)) {
- this.jarPaths.add(filePath);
- }
- }
-
- // ********** JarsGroup class **********
-
- private class JarsGroup {
-
-
- // ********** constructor **********
-
- private JarsGroup(Composite parent) {
- super();
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(2, false); //must be 4 for the package controls
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, HELP_CONTEXT_ID);
-
- this.buildLabel(composite, 2, JptDbwsUiMessages.JdbcDriverWizardPage_driverFiles);
-
- this.buildDriverFilesTable(composite);
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- IWizard wizard = getWizard();
-
- if( ! (wizard instanceof DbwsGeneratorWizard)) {
- throw new NullPointerException();
- }
- return ((DbwsGeneratorWizard)wizard).getJavaProject();
- }
-
- private ArrayList<String> getJarPaths() {
- return jarPaths;
- }
-
- // ********** private methods **********
-
- private TableViewer buildDriverFilesTable(Composite parent) {
-
- TableViewer tableViewer = this.buildTableViewer(parent, this.getJarPaths());
-
- this.buildAddRemoveButtons(parent, tableViewer);
- return tableViewer;
- }
-
- private TableViewer buildTableViewer(Composite parent, ArrayList<String> tableDataModel) {
-
- TableLayoutComposite tableLayout = new TableLayoutComposite(parent, SWT.NONE);
- this.addColumnsData(tableLayout);
-
- final Table table = new Table(tableLayout, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
- table.setLinesVisible(false);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setResizable(true);
-
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- gridData.heightHint= SWTUtil.getTableHeightHint(table, 7);
- tableLayout.setLayoutData(gridData);
-
- TableViewer tableViewer = new TableViewer(table);
- tableViewer.setUseHashlookup(true);
- tableViewer.setLabelProvider(this.buildLabelProvider());
- tableViewer.setContentProvider(this.buildContentProvider());
-
- tableViewer.setInput(tableDataModel);
- tableViewer.refresh();
- return tableViewer;
- }
-
- private void buildAddRemoveButtons(Composite parent, final TableViewer tableViewer) {
-
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
- // Add buttons
- Button addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText(JptDbwsUiMessages.JdbcDriverWizardPage_addButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- addButton.setLayoutData(gridData);
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- ArrayList<String> jarFiles = promptJarFiles();
- for(String jarFile : jarFiles) {
- addJarFile(jarFile);
- }
- tableViewer.refresh();
- }
- });
- // Remove buttons
- Button removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText(JptDbwsUiMessages.JdbcDriverWizardPage_removeButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- removeButton.setLayoutData(gridData);
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- StructuredSelection selection = (StructuredSelection)tableViewer.getSelection();
- if(selection.isEmpty()) {
- return;
- }
- String jarFile = (String)selection.getFirstElement();
- removeJarFile(jarFile);
-
- tableViewer.refresh();
- }
- });
- addButton.setFocus();
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new TableLabelProvider();
- }
-
- private IContentProvider buildContentProvider() {
- return new TableContentProvider();
- }
-
- private ArrayList<String> promptJarFiles() {
- String projectPath= this.getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell(), SWT.MULTI);
- dialog.setText(JptDbwsUiMessages.JdbcDriverWizardPage_chooseADriverFile);
- dialog.setFilterPath(projectPath);
- dialog.setFilterExtensions(new String[] {BINDINGS_FILE_FILTER});
-
- dialog.open();
- String path = dialog.getFilterPath();
- String[] fileNames = dialog.getFileNames();
- ArrayList<String> results = new ArrayList<String>(fileNames.length);
- for(String fileName : fileNames) {
- results.add(path + File.separator + fileName);
- }
- return results;
- }
-
- private void addColumnsData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- /**
- * Build and return a label
- */
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- // ********** inner class **********
-
- private class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- return (String)element;
- }
- }
-
- private class TableContentProvider implements IStructuredContentProvider {
-
- TableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
deleted file mode 100644
index 7f36cc306f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-
-public class SelectFileOrXMLCatalogIdPanel extends Composite implements SelectionListener {
-
- public interface PanelListener {
- void completionStateChanged();
- }
-
- protected PanelListener listener;
- protected PageBook pageBook;
-
- protected SelectFilePanel selectFilePanel;
- protected SelectXMLCatalogIdPanel selectXMLCatalogIdPanel;
-
- // ********** constructor **********
-
- public SelectFileOrXMLCatalogIdPanel(Composite parent, IStructuredSelection selection) {
- super(parent, SWT.NONE);
-
- // container group
- setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 400;
- gd.widthHint = 400;
- setLayoutData(gd);
-
- pageBook = new PageBook(this, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- selectFilePanel = new SelectFilePanel(pageBook, selection);
- this.setSingleFileViewDefaultSelection(selection);
-
- // Catalog
- ICatalog xmlCatalog = JptDbwsUiPlugin.instance().getDefaultXMLCatalog();
- selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
- selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateCompletionStateChange();
- }
- });
- Dialog.applyDialogFont(parent);
- pageBook.showPage(selectFilePanel.getControl());
- }
-
- public void setSingleFileViewDefaultSelection(ISelection selection) {
- this.selectFilePanel.setDefaultSelection(selection);
- }
-
- public IFile getFile() {
- return selectFilePanel.getFile();
- }
-
- public String getXMLCatalogURI() {
- return null; // XMLCatalog not supported
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- selectXMLCatalogIdPanel.setCatalogEntryType(catalogEntryType);
- }
-
- public void setFilterExtensions(String[] filterExtensions) {
- selectFilePanel.resetFilters();
- selectFilePanel.addFilterExtensions(filterExtensions);
-
- selectXMLCatalogIdPanel.getTableViewer().setFilterExtensions(filterExtensions);
- }
-
- public void setListener(PanelListener listener) {
- this.listener = listener;
- }
-
- public void setVisibleHelper(boolean isVisible) {
- selectFilePanel.setVisibleHelper(isVisible);
- }
-
- public void updateCompletionStateChange() {
- if (listener != null) {
- listener.completionStateChanged();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- pageBook.showPage(selectFilePanel.getControl());
-
- updateCompletionStateChange();
- }
-
- // ********** inner class **********
-
- protected class SelectFilePanel extends SelectSingleFileViewFacade implements SelectSingleFileViewFacade.Listener {
- protected Control control;
-
- public SelectFilePanel(Composite parent, IStructuredSelection selection) {
- super(selection, true);
- // String[] ext = {".dtd"};
- // addFilterExtensions(ext);
- control = createControl(parent);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
- SelectFilePanel.this.setListener(this);
- }
-
- public Control getControl() {
- return control;
- }
-
- public void setControlComplete(boolean isComplete) {
- updateCompletionStateChange();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.java
deleted file mode 100644
index c5363d54e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectSingleFileViewFacade.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.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SelectSingleFileView
- *
- * Façade class to change accessibility of SelectSingleFileView.
- */
-@SuppressWarnings("restriction")
-public class SelectSingleFileViewFacade extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView {
-
- public static interface Listener extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.Listener
- {}
-
- public SelectSingleFileViewFacade(IStructuredSelection selection, boolean isFileMandatory) {
- super(selection, isFileMandatory);
- }
-
- public void addFilterExtensions(String[] filterExtensions) {
- super.addFilterExtensions(filterExtensions);
- }
-
- public Composite createControl(Composite parent) {
- return super.createControl(parent);
- }
-
- public IFile getFile() {
- return super.getFile();
- }
-
- public void resetFilters() {
- super.resetFilters();
- }
-
- public void setVisibleHelper(boolean isVisible) {
- super.setVisibleHelper(isVisible);
- }
-
- public void setDefaultSelection(ISelection selection) {
- super.setDefaultSelection(selection);
- }
-
- public void setListener(Listener listener) {
- super.setListener(listener);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
deleted file mode 100644
index 3e1ec46a64..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-public class SelectXMLCatalogIdPanel extends Composite {
- protected int catalogEntryType;
- protected boolean doTableSizeHack = false;
-
- protected XMLCatalogTableViewer tableViewer;
- protected ICatalog fXmlCatalog;
-
- public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
- super(parent, SWT.NONE);
- this.fXmlCatalog = xmlCatalog;
-
- GridLayout gridLayout = new GridLayout();
- this.setLayout(gridLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- gd.widthHint = 700;
- this.setLayoutData(gd);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogTableTitle);
-
- tableViewer = createTableViewer(this);
- tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- tableViewer.setInput("dummy"); //$NON-NLS-1$
- }
-
- protected XMLCatalogTableViewer createTableViewer(Composite parent) {
- String headings[] = new String[2];
- headings[0] = JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogKeyColumn;
- headings[1] = JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogUriColumn;
-
- XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
-
- protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
- for (int i = 0; i < entries.length; i++) {
- ICatalogEntry entry = entries[i];
- if (catalogEntryType == 0) {
- list.add(entry);
- }
- else if (catalogEntryType == entry.getEntryType()) {
- list.add(entry);
- }
- }
- }
-
- public Collection getXMLCatalogEntries() {
- List result = null;
-
- if ((fXmlCatalog == null) || doTableSizeHack) {
- // this lets us create a table with an initial height of
- // 10 rows
- // otherwise we get stuck with 0 row heigh table... that's
- // too small
- doTableSizeHack = false;
- result = new Vector();
- for (int i = 0; i < 6; i++) {
- result.add(""); //$NON-NLS-1$
- }
- }
- else {
- result = new Vector();
- INextCatalog[] nextCatalogs = fXmlCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (JptDbwsUiPlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog systemCatalog = referencedCatalog;
- addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
-
- }
- else if (JptDbwsUiPlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog userCatalog = referencedCatalog;
- addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
-
- }
- }
- }
- }
- return result;
- }
- };
- return theTableViewer;
- }
-
-
- public String getId() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getKey() : null;
- }
-
- public XMLCatalogTableViewer getTableViewer() {
- return tableViewer;
- }
-
- public String getURI() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getURI() : null;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogEntry) {
- result = (ICatalogEntry) selectedObject;
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- this.catalogEntryType = catalogEntryType;
- tableViewer.refresh();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java
deleted file mode 100644
index 0e32bfda55..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/WebDynamicProjectWizardPage.java
+++ /dev/null
@@ -1,38 +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.dbws.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-
-/**
- * WebDynamicProjectWizardPage
- */
-public class WebDynamicProjectWizardPage extends JavaProjectWizardPage {
-
- public WebDynamicProjectWizardPage(IJavaProject javaProject) {
- super(javaProject);
- }
-
- @Override
- protected Iterable<IProject> getJavaProjects() {
- return new FilteringIterable<IProject>(CollectionTools.collection(this.getProjects())) {
- @Override
- protected boolean accept(IProject next) {
- return DbwsGeneratorUi.projectIsWebDynamic(next);
- }
- };
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
deleted file mode 100644
index c556561adf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-import com.ibm.icu.text.Collator;
-
-public class XMLCatalogTableViewer extends TableViewer {
-
- protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-
- protected static Image dtdFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/dtdfile.gif"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/text.gif"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptDbwsUiPlugin.getImage("icons/full/obj16/XSDFile.gif"); //$NON-NLS-1$
- protected static Image errorImage = JptDbwsUiPlugin.getImage("icons/full/ovr16/error_ovr.gif"); //$NON-NLS-1$
-
- // ********** constructor **********
-
- public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
- super(parent, SWT.FULL_SELECTION);
-
- Table table = getTable();
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- for (int i = 0; i < columnProperties.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(50, true));
- }
- table.setLayout(layout);
- table.setLinesVisible(false);
-
- setColumnProperties(columnProperties);
-
- setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
- }
-
- public Collection getXMLCatalogEntries() {
- return null;
- }
-
- public void menuAboutToShow(IMenuManager menuManager) {
- Action action = new Action("hello") { //$NON-NLS-1$
- public void run() {
- System.out.println("run!"); //$NON-NLS-1$
- }
- };
- menuManager.add(action);
- }
-
- public void setFilterExtensions(String[] extensions) {
- resetFilters();
- addFilter(new XMLCatalogTableViewerFilter(extensions));
- }
-
- // ********** inner class **********
-
- public class CatalogEntryContentProvider implements IStructuredContentProvider {
-
- public void dispose() {
- }
-
- public Object[] getElements(Object element) {
- Object[] array = getXMLCatalogEntries().toArray();
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- int result = 0;
- if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) {
- ICatalogEntry mappingInfo1 = (ICatalogEntry) o1;
- ICatalogEntry mappingInfo2 = (ICatalogEntry) o2;
- result = Collator.getInstance().compare(mappingInfo1.getKey(), mappingInfo2.getKey());
- }
- return result;
- }
- };
- Arrays.sort(array, comparator);
- return array;
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- if (columnIndex == 0) {
- Image base = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- if (uri.endsWith("dtd")) { //$NON-NLS-1$
- base = dtdFileImage;
- }
- else if (uri.endsWith("xsd")) { //$NON-NLS-1$
- base = xsdFileImage;
- }
- else {
- base = unknownFileImage;
- }
-
- if (base != null) {
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- // TODO... SSE port
- result = base;// imageFactory.createCompositeImage(base,
- // errorImage,
- // ImageFactory.BOTTOM_LEFT);
- }
- }
- }
- }
- return result;
- }
-
- public String getColumnText(Object object, int columnIndex) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
- result = URIHelper.removePlatformResourceProtocol(result);
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
- }
-
- class XMLCatalogTableViewerFilter extends ViewerFilter {
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions) {
- this.extensions = extensions;
- }
-
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean result = false;
- if (element instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++) {
- if (catalogEntry.getURI().endsWith(extensions[i])) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project
deleted file mode 100644
index 98560920c2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 1eae124537..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/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>June 06, 2007</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> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties
deleted file mode 100644
index 9bd22c769c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/about.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties
deleted file mode 100644
index 11a4e44db6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/build.properties
+++ /dev/null
@@ -1,18 +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
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml
deleted file mode 100644
index bc275a758e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/component.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jaxb.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.png b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties
deleted file mode 100644
index fbe477feb2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.branding/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <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"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
deleted file mode 100644
index 025cb3b6fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core.schemagen</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.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index 74056248bf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.core.schemagen;singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind
-Export-Package: org.eclipse.jpt.jaxb.core.schemagen,
- org.eclipse.jpt.jaxb.core.schemagen.internal;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html
+++ /dev/null
@@ -1,47 +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">
-
-<H2>About This Content</H2>
-
-<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>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties
deleted file mode 100644
index 8ac4a493cc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties
deleted file mode 100644
index 2e7dfca4c9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JAXB Support - Schema Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java
deleted file mode 100644
index 9f6a922785..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java
+++ /dev/null
@@ -1,287 +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.schemagen;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jpt.jaxb.core.schemagen.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.schemagen.internal.Tools;
-
-/**
- * Generate a JAXB Schema
- *
- * Current command-line arguments:
- * [-s schema.xsd] - specifies the target schema
- * [-c className] - specifies the fully qualified class name
- *
- * [-p packageName] - specifies the source package // @deprecated
- */
-public class Main
-{
- private String[] sourceClassNames;
- private String targetSchemaName;
- @SuppressWarnings("unused")
- private boolean isDebugMode;
-
- static public String NO_FACTORY_CLASS = "doesnt contain ObjectFactory.class"; //$NON-NLS-1$
-
- // ********** static methods **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- // ********** constructors **********
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
-
- this.initializeWith(args);
-
- this.generate();
- }
-
- // ********** internal methods **********
-
- private void initializeWith(String[] args) {
- this.sourceClassNames = this.getSourceClassNames(args);
- this.targetSchemaName = this.getTargetSchemaName(args);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void generate() {
- // Create the JAXBContext
- JAXBContext jaxbContext = this.buildJaxbContext();
-
- // Generate an XML Schema
- if(jaxbContext != null) {
- this.generateSchema(jaxbContext);
- }
- else {
- System.out.println(Tools.bind(JptJaxbCoreMessages.SCHEMA_NOT_CREATED, this.targetSchemaName));
- }
- }
-
- private JAXBContext buildJaxbContext() {
- System.out.println(Tools.getString(JptJaxbCoreMessages.LOADING_CLASSES));
- JAXBContext jaxbContext = null;
- try {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- Class[] sourceClasses = this.buildSourceClasses(this.sourceClassNames, loader);
-
- jaxbContext = JAXBContext.newInstance(sourceClasses);
- }
- catch(JAXBException ex) {
- this.handleException(ex);
- }
- return jaxbContext;
- }
-
- private void generateSchema(JAXBContext jaxbContext) {
- System.out.println(Tools.getString(JptJaxbCoreMessages.GENERATING_SCHEMA));
- System.out.flush();
-
- SchemaOutputResolver schemaOutputResolver =
- new JptSchemaOutputResolver(this.targetSchemaName);
-
- try {
- jaxbContext.generateSchema(schemaOutputResolver);
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private Class[] buildSourceClasses(String[] classNames, ClassLoader loader) {
-
- ArrayList<Class> sourceClasses = new ArrayList<Class>(classNames.length);
- for(String className: classNames) {
- try {
- sourceClasses.add(loader.loadClass(className));
- System.out.println(className);
- }
- catch (ClassNotFoundException e) {
- System.err.println(Tools.bind(JptJaxbCoreMessages.NOT_FOUND, className));
- }
- }
- System.out.flush();
- return sourceClasses.toArray(new Class[0]);
- }
-
- private void handleException(JAXBException ex) {
- String message = ex.getMessage();
- Throwable linkedEx = ex.getLinkedException();
- if(message != null && message.indexOf(NO_FACTORY_CLASS) > -1) {
- System.err.println(message);
- }
- else if(linkedEx != null && linkedEx instanceof ClassNotFoundException) {
- String errorMessage = Tools.bind(JptJaxbCoreMessages.CONTEXT_FACTORY_NOT_FOUND, linkedEx.getMessage());
- System.err.println(errorMessage);
- }
- else {
- ex.printStackTrace();
- }
- }
-
- // ********** argument queries **********
-
- private String[] getSourceClassNames(String[] args) {
-
- return this.getAllArgumentValue("-c", args); //$NON-NLS-1$
- }
-
- private String getTargetSchemaName(String[] args) {
-
- return this.getArgumentValue("-s", args); //$NON-NLS-1$
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- // ********** private methods **********
-
- private String getArgumentValue(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private String[] getAllArgumentValue(String argName, String[] args) {
- List<String> argValues = new ArrayList<String>();
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- argValues.add(args[j]);
- i++;
- }
- }
- }
- return argValues.toArray(new String[0]);
- }
-
- private boolean argumentExists(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- return true;
- }
- }
- return false;
- }
-
-}
-
-// ********** inner class **********
-
-class JptSchemaOutputResolver extends SchemaOutputResolver {
-
- private final String defaultSchemaName;
-
- // ********** constructor **********
-
- protected JptSchemaOutputResolver(String defaultSchemaName) {
- this.defaultSchemaName = defaultSchemaName;
- }
-
- // ********** overrides **********
-
- @Override
- public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException {
-
- String filePath = (Tools.stringIsEmpty(namespaceURI)) ?
- this.buildFileNameFrom(this.defaultSchemaName, suggestedFileName) :
- this.modifyFileName(namespaceURI);
-
- filePath = this.canonicalFileName(filePath);
- File file = new File(filePath);
- StreamResult result = new StreamResult(file);
- result.setSystemId(file.toURL().toExternalForm());
-
- System.out.print(Tools.bind(JptJaxbCoreMessages.SCHEMA_GENERATED, file));
- return result;
- }
-
- // ********** private methods **********
-
- private String buildFileNameFrom(String fileName, String suggestedFileName) {
-
- fileName = Tools.stripExtension(fileName);
-
- if(Tools.stringIsEmpty(fileName)) {
- return suggestedFileName;
- }
- String number = Tools.extractFileNumber(suggestedFileName);
-
- fileName = this.buildFileName(fileName, number);
- return Tools.appendXsdExtension(fileName);
- }
-
- private String buildFileName(String fileName, String number) {
-
- if(Tools.stringIsEmpty(number)) {
- return fileName;
- }
- return (number.equals("0")) ? fileName : fileName + number; //$NON-NLS-1$
- }
-
- private String modifyFileName(String namespaceURI) throws IOException {
-
- String dir = Tools.extractDirectory(this.defaultSchemaName);
-
- String fileName = Tools.stripProtocol(namespaceURI);
- fileName = fileName.replaceAll("/", "_"); //$NON-NLS-1$
- fileName = Tools.appendXsdExtension(fileName);
-
- String result = (Tools.stringIsEmpty(dir)) ? fileName : dir + File.separator + fileName;
-
- return result;
- }
-
- private String canonicalFileName(String fileName) {
- return this.canonicalFile(new File(fileName)).getAbsolutePath();
- }
-
- private File canonicalFile(File file) {
- try {
- return file.getCanonicalFile();
- }
- catch (IOException ioexception) {
- return file.getAbsoluteFile();
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java
deleted file mode 100644
index 49170533dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.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.schemagen.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localized messages used by Dali JAXB core.
- */
-public class JptJaxbCoreMessages
-{
-
- public static final String LOADING_CLASSES = "LOADING_CLASSES";
- public static final String GENERATING_SCHEMA = "GENERATING_SCHEMA";
- public static final String SCHEMA_GENERATED = "SCHEMA_GENERATED";
- public static final String SCHEMA_NOT_CREATED = "SCHEMA_NOT_CREATED";
- public static final String NOT_FOUND = "NOT_FOUND";
- public static final String CONTEXT_FACTORY_NOT_FOUND = "CONTEXT_FACTORY_NOT_FOUND";
-
-
- private static final String BUNDLE_NAME = "org.eclipse.jpt.jaxb.core.schemagen.internal.jpt_jaxb_core"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private JptJaxbCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.java
deleted file mode 100644
index 6427661dcd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/Tools.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.schemagen.internal;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-/**
- * Tools
- */
-public final class Tools
-{
- /** default file name used by the schemagen */
- static public String GEN_DEFAULT_NAME = "schema"; //$NON-NLS-1$
-
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if (string == null) {
- return true;
- }
- int len = string.length();
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string.toCharArray(), len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- // ********** short name manipulation **********
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- public static String stripProtocol(String uri) {
-
- return uri.replaceFirst("http://", EMPTY_STRING);
- }
-
-
- public static String appendXsdExtension(String name) {
-
- return name + ".xsd"; //$NON-NLS-1$
- }
-
- public static String extractFileNumber(String fileName) {
-
- String result = stripExtension(fileName);
- if(Tools.stringIsEmpty(result)) {
- return EMPTY_STRING;
- }
- return result.replaceFirst(GEN_DEFAULT_NAME, EMPTY_STRING);
- }
-
- public static String extractDirectory(String path) {
- if( ! path.contains(File.separator)) {
- return EMPTY_STRING;
- }
- return path.substring(0, path.lastIndexOf(File.separator));
- }
-
- // ********** NLS utilities **********
-
- public static String getString(String key) {
- return JptJaxbCoreMessages.getString(key);
- }
-
- public static String bind(String key, Object argument) {
- return MessageFormat.format(getString(key), argument);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties
deleted file mode 100644
index b9112cd725..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties
+++ /dev/null
@@ -1,19 +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
-################################################################################
-
-LOADING_CLASSES = loading...
-GENERATING_SCHEMA = \ngenerating schema...
-SCHEMA_GENERATED = \nSchema {0} generated
-SCHEMA_NOT_CREATED = \nSchema {0} not created
-NOT_FOUND = \n\tNot found: {0}
-CONTEXT_FACTORY_NOT_FOUND = \nThe JAXBContextFactory {0} \n\
-specified in the jaxb.properties file could not be located on the project classpath. \n\
-The JAXB provider that defines this factory should be added to the project classpath, \n\
-or the jaxb.properties file should be removed to use the default provider.
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 934fb38085..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath
+++ /dev/null
@@ -1,13 +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/**"/>
- </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 31362a7d19..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.*
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/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
deleted file mode 100644
index e49484abc0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,50 +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.0.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-friends:="org.eclipse.jpt.jaxb.ui",
- 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-friends:="org.eclipse.jpt.jaxb.ui",
- org.eclipse.jpt.jaxb.core.internal.platform;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.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.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 93b16b88ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
+++ /dev/null
@@ -1,20 +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
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
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 6f814334bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
+++ /dev/null
@@ -1,31 +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_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 version.
-
-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 cda3f8216d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
+++ /dev/null
@@ -1,298 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- 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
- -->
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jaxbPlatforms"
- name="%JAXB_PLATFORMS"
- schema="schema/jaxbPlatforms.exsd"/>
-
-
- <!-- ***** extensions ***** -->
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.platformResource"
- type="org.eclipse.core.resources.IResource"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.javaElement"
- type="org.eclipse.jdt.core.IJavaElement"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- <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.JaxbPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.jaxbLibraryProviderConfig"
- type="org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.JaxbPlatformTester"/>
-
- </extension>
-
- <!-- =================================================================================== -->
- <!-- Extension: JAXB Problem Marker -->
- <!-- **** 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>
-
-
- <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>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
-
- <supported>
- <facet id="jpt.jaxb"/>
- <runtime-component any="true"/>
- </supported>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jpt.jaxb">
- <label>%JAXB_FACET_LABEL</label>
- <description>%JAXB_FACET_DESCRIPTION</description>
- </project-facet>
-
- <project-facet-version facet="jpt.jaxb" version="2.1">
- <constraint>
- <requires facet="java" version="[5.0"/>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jpt.jaxb" version="2.2">
- <constraint>
- <requires facet="java" version="[5.0"/>
- </constraint>
- </project-facet-version>
-
- <template id="jpt.jaxb.template">
- <label>%JAXB_TEMPLATE_LABEL</label>
- <fixed facet="jpt.jaxb"/>
- <fixed facet="java"/>
- </template>
-
- <action facet="jpt.jaxb" type="install" id="jpt.jaxb.install">
- <config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProvider"/>
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDelegate"/>
- </action>
-
- <action facet="jpt.jaxb" type="version-change" id="jpt.jaxb.version-change">
- <config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProvider"/>
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDelegate"/>
- </action>
-
- <action facet="jpt.jaxb" type="uninstall" id="jpt.jaxb.uninstall">
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetUninstallDelegate"/>
- </action>
-
- </extension>
-
-
- <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"/>
- </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 321b87376d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
+++ /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
-################################################################################
-
-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.
-
-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_TYPE_UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = The namespace for an anonymous type should not be different from its package
-XML_TYPE_UNRESOLVED_SCHEMA_TYPE = The type definition with name ''{0}'' and namespace ''{1}'' cannot be resolved
-
-XML_ROOT_ELEMENT_UNRESOLVED_SCHEMA_ELEMENT = The element declaration with name ''{0}'' and namespace ''{1}'' cannot be resolved
-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
-
-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 = XmlElementWrapper is only allowed on a collection or array property
-XML_LIST_DEFINED_ON_NON_ARRAY_NON_COLLECTION = XmlList is only allowed on a collection or array property
-MULTIPLE_XML_ANY_ELEMENT_MAPPINGS_DEFINED = Attribute ''{0}'' cannot be mapped as XmlAnyElement because attribute ''{1}'' is already mapped as XmlAnyElement, cannot define multiple XmlAnyElement mappings
-MULTIPLE_XML_ANY_ATTRIBUTE_MAPPINGS_DEFINED = Attribute ''{0}'' cannot be mapped as XmlAnyAttribute because attribute ''{1}'' is already mapped as XmlAnyAttribute, cannot define multiple XmlAnyAttribute mappings
-MULTIPLE_XML_VALUE_MAPPINGS_DEFINED = Attribute ''{0}'' cannot be mapped as XmlValue because attribute ''{1}'' is already mapped as XmlValue, cannot define multiple XmlValue mappings
-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_ANY_ATTRIBUTE_MAPPING_DEFINED_ON_NON_MAP = XmlAnyAttribute is only allowed on a property assignable to java.util.Map
-XML_ID_DEFINED_ON_NON_STRING = XmlID is only allowed on a java.lang.String property
-MULTIPLE_XML_IDS_DEFINED = Attribute ''{0}'' cannot have an XmlID because attribute ''{1}'' already has an XmlID, cannot define multiple mappings with XmlID
-XML_IDREF_TYPE_DOES_NOT_CONTAIN_XML_ID = Attribute ''{0}'' is an XmlIDREF, type ''{1}'' must contain a property or field annotated with @XmlId \ 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 0688655614..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
+++ /dev/null
@@ -1,22 +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
-################################################################################
-
-SchemaGenerator_creatingJAXBPropertiesFileTask = Creating jaxb.properties file
-
-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 = Project JRE does not support the current JAXB platform.
-JreLibraryValidator_invalidJreJaxbVersion = Project JRE does not support the current JAXB version.
-
-PREFERENCES_FLUSH_JOB_NAME=Flush Preferences: {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/AnnotationProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationProvider.java
deleted file mode 100644
index 034e5615e9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationProvider.java
+++ /dev/null
@@ -1,79 +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.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-
-/**
- * This is used to provide type and attribute annotations.
- * Also provides list of supported annotation names, check the appropriate list
- * before trying to build an annotation with that name. An exception will
- * be thrown on an attempt to build an annotation that does not exist.
- *
- * This interface is not intended to be implemented. Instead implement
- * AnnotationDefinitionProvider to extend the list of supported annotation definitions.
- *
- * @see AnnotationDefinitionProvider
- * @version 3.0
- * @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 AnnotationProvider {
-
- /**
- * Return the names of the annotations.
- */
- Iterable<String> getAnnotationNames();
-
- Iterable<String> getContainerAnnotationNames();
-
- Iterable<String> getNestableAnnotationNames();
-
- String getNestableAnnotationName(String containerAnnotationName);
-
- String getNestableElementName(String nestableAnnotationName);
-
- /**
- * Build an annotation with the specified name.
- * Throw an IllegalArgumentException if the specified name is unsupported.
- * @see #getAnnotationNames()
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName);
-
- /**
- * Build a nestable annotation with the specified name and index.
- * Throw an IllegalArgumentException if the specified name is unsupported.
- * @see #getNestableAnnotationNames()
- */
- NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName, int index);
-
- /**
- * Build an annotation for the specified JDT annotation.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #getAnnotationNames()
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation);
-
- /**
- * Build a null annotation with the specified name.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #getAnnotationNames()
- */
- Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent, String annotationName);
-}
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 c4056c7bd5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
+++ /dev/null
@@ -1,1038 +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.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.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.utility.Command;
-import org.eclipse.jpt.common.utility.internal.AsynchronousCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.SimpleCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StatefulCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.jaxb.core.internal.SimpleJaxbProjectConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-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 AsynchronousCommandExecutor(JptCommonCoreMessages.DALI_EVENT_HANDLER_THREAD_NAME);
-
- /**
- * 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);
- this.eventHandler.stop();
- 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.setUpdateSynchronizer(new CallbackAsynchronousSynchronizer());
- 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 */ 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 JptCoreTestsPlugin#start(BundleContext)
- */
- public void handleEventsSynchronously() {
- try {
- this.lock.acquire();
- this.handleEventsSynchronously_();
- } finally {
- this.lock.release();
- }
- }
-
- private void handleEventsSynchronously_() {
- this.eventHandler.stop();
- this.eventHandler = new SimpleCommandExecutor();
- 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 1a91dc7acb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
+++ /dev/null
@@ -1,147 +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.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-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.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentType;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass;
-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.XmlNs;
-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.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-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 JavaEntity}), ORM (e.g.
- * {@link EntityMappings}), or persistence (e.g. {@link PersistenceUnit})
- * context model objects.
- * <p>
- * Assumes a base JAXB project context structure
- * corresponding to the JAXB spec:
- * <pre>
- * RootContext
- * |- persistence.xml
- * |- persistence unit(s)
- * |- mapping file(s) (e.g. orm.xml)
- * | |- persistent type mapping(s) (e.g. Entity)
- * | |- persistent attribute mapping(s) (e.g. Basic)
- * |- persistent type mapping(s)
- * </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.0
- * @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);
-
- JaxbRegistry buildRegistry(JaxbContextRoot parent, JavaResourceType resourceType);
-
- JaxbTransientClass buildJavaTransientClass(JaxbContextRoot parent, JavaResourceType resourceType);
-
- JaxbPersistentClass buildJavaPersistentClass(JaxbContextRoot parent, JavaResourceType resourceType);
-
- JaxbPersistentEnum buildJavaPersistentEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum);
-
- XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent);
-
- XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation);
-
- XmlRootElement buildJavaXmlRootElement(JaxbPersistentType parent, XmlRootElementAnnotation xmlRootElementAnnotation);
-
- JaxbEnumConstant buildJavaEnumConstant(JaxbPersistentEnum parent, JavaResourceEnumConstant resourceEnumConstant);
-
- JaxbElementFactoryMethod buildJavaElementFactoryMethod(JaxbRegistry parent, JavaResourceMethod resourceMethod);
-
- JaxbPersistentField buildJavaPersistentField(JaxbPersistentClass parent, JavaResourceField resourceField);
-
- JaxbPersistentProperty buildJavaPersistentProperty(JaxbPersistentClass 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);
-
- JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent);
-
- XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent);
-
-}
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 a4eb6c5099..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.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.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.core.IResourcePart;
-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, IResourcePart
-{
- /**
- * 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();
-}
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 0845231e37..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
+++ /dev/null
@@ -1,373 +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.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.utility.CommandExecutor;
-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.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-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);
-
-
- // **************** 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 CommandExecutor}
- * 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 CommandExecutor}.
- */
- void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor);
-
- /**
- * Return the project-wide implementation of the
- * {@link CommandExecutor} interface.
- */
- CommandExecutor 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 acba0d5a92..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
+++ /dev/null
@@ -1,464 +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.HashMap;
-import java.util.Map;
-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.Platform;
-import org.eclipse.core.runtime.Plugin;
-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.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformManagerImpl;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.osgi.util.NLS;
-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.osgi.framework.BundleContext;
-import org.osgi.service.prefs.BackingStoreException;
-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 {
-
- private static volatile boolean flushPreferences = true;
-
- /**
- * 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 node for storing a JAXB project's platform in the project's preferences.
- */
- public static final String PLATFORM_PREF_NODE = "platform"; //$NON-NLS-1$
-
- /**
- * The key for storing the platform id
- */
- public static final String PLATFORM_ID_PREF_KEY = "platform-id"; //$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 namespace in the project's preferences
- */
- public static final String SCHEMA_NAMESPACE_PREF_KEY = "namespace"; //$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$
-
- /**
- * 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 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$
-
-
-
- // **************** 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();
- }
-
- /**
- * Return the default Dali preferences
- * @see JpaPreferenceInitializer
- */
- public static IEclipsePreferences getDefaultPreferences() {
- return getPreferences(new DefaultScope());
- }
-
- /**
- * Return the Dali preferences for the current workspace instance.
- */
- public static IEclipsePreferences getWorkspacePreferences() {
- return getPreferences(new InstanceScope());
- }
-
- /**
- * Return the Dali preferences for the specified context.
- */
- private static IEclipsePreferences getPreferences(IScopeContext context) {
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Set the workspace preference.
- */
- public static void setWorkspacePreference(String preferenceKey, String preferenceValue) {
- IEclipsePreferences prefs = getWorkspacePreferences();
- prefs.put(preferenceKey, preferenceValue);
- flush(prefs);
- }
-
- /**
- * 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) {
- log(ex);
- }
- return Status.OK_STATUS;
- }
- }
-
- public static Preferences getProjectPreferences(IProject project) {
- try {
- IFacetedProject fproj = ProjectFacetsManager.create(project);
- return fproj.getPreferences(JaxbFacet.FACET);
- }
- catch (BackingStoreException bse) {
- log(bse);
- }
- catch (CoreException ce) {
- log(ce);
- }
- return null;
- }
-
- /**
- * 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 = DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (JaxbFacet.VERSION_2_2.equals(jaxbFacetVersion)) {
- preferenceKey = DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- 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,
- getWorkspacePreferences(),
- 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, 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 = DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_2)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_2;
- preferenceKey = 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) {
- Preferences prefs = getProjectPreferences(project);
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- return platformPrefs.get(PLATFORM_ID_PREF_KEY, GenericJaxbPlatform.VERSION_2_1.getId());
- }
-
- /**
- * 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) {
- Preferences prefs = getProjectPreferences(project);
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- platformPrefs.put(PLATFORM_ID_PREF_KEY, platform.getId());
- try {
- platformPrefs.flush();
- }
- catch (BackingStoreException bse) {
- log(bse);
- }
- }
-
- public static Map<String, String> getSchemaLocationMap(IProject project) {
- Map<String, String> schemaLocationMap = new HashMap<String, String>();
- Preferences prefs = getProjectPreferences(project);
- 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 namespace = schemaPrefs.get(SCHEMA_NAMESPACE_PREF_KEY, null);
- String location = schemaPrefs.get(SCHEMA_LOCATION_PREF_KEY, null);
- if (namespace != null) {
- schemaLocationMap.put(namespace, 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 schemaLocationMap;
- }
-
- public static void setSchemaLocationMap(IProject project, Map<String, String> schemaLocationMap) {
- Preferences prefs = getProjectPreferences(project);
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- int i = 1;
- for (String namespace : schemaLocationMap.keySet()) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- Preferences schemaPref = schemasPrefs.node(nodeName);
- schemaPref.put(SCHEMA_NAMESPACE_PREF_KEY, namespace);
- schemaPref.put(SCHEMA_LOCATION_PREF_KEY, schemaLocationMap.get(namespace));
- 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);
- }
- }
-
- /**
- * 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 c004390a0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.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;
-
-/**
- *
- *
- * 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 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_TRANSIENT_ATTRIBUTE_MAPPING_KEY = "xml-transient";
- String XML_VALUE_ATTRIBUTE_MAPPING_KEY = "xml-value";
- String NULL_ATTRIBUTE_MAPPING_KEY = null;
-}
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 fe52356cbc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.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 java.util.Map;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * Entry point for accessing project schema resources
- *
- * @version 3.0
- * @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 {
-
- public XSDSchema getSchema(String namespace);
-
- /**
- * Return the project settings that indicate how schema keys are mapped to actual
- * resolvable schemas
- */
- public Map<String, String> getSchemaLocations();
-
- /**
- * Set the project settings that indicate how schema keys are mapped to actual
- * resolvable schemas.
- */
- public void setSchemaLocations(Map<String, String> schemaLocations);
-}
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 54202f9677..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.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;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-
-
-/**
- * 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.0
- * @since 3.0
- */
-public interface JaxbAttributeMapping
- extends JavaContextNode {
-
- JaxbPersistentAttribute getParent();
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- String getKey();
-
- /**
- * Return whether the mapping is its attribute's <em>default</em> mapping
- * (as opposed to its <em>specified</em> mapping).
- */
- boolean isDefault();
- String DEFAULT_PROPERTY = "default"; //$NON-NLS-1$
-
- void updateDefault();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- * Nulls and empty strings are to be expected.
- */
- Iterable<String> getDirectlyReferencedTypeNames();
-}
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 aa3bf40d80..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
+++ /dev/null
@@ -1,58 +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.resource.java.JavaResourceType;
-
-/**
- * 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();
-
- 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/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 a1269911c8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.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.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * Represents a JAXB class.
- * <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, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- /**
- * covariant override
- */
- JavaResourceType getJavaResourceType();
-
- JaxbClass getSuperClass();
- String SUPER_CLASS_PROPERTY = "superClass"; //$NON-NLS-1$
-
- /**
- * Return the persistent type's "persistence" inheritance hierarchy,
- * <em>including</em> the persistent type itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop. This includes classes annotated with @XmlTransient.
- */
- Iterable<JaxbClass> getInheritanceHierarchy();
-
- /**
- * Return the persistent type's "persistence" inheritance hierarchy,
- * <em>excluding</em> the persistent type itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop. This includes classes annotated with @XmlTransient.
- */
- Iterable<JaxbClass> getAncestors();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContainmentMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContainmentMapping.java
deleted file mode 100644
index 20097e7bc7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContainmentMapping.java
+++ /dev/null
@@ -1,93 +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 containment mappings (xml element/attribute)
- * <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 JaxbContainmentMapping
- extends JaxbAttributeMapping, XmlAdaptable {
-
-
- String getName();
- String getDefaultName();
- String getSpecifiedName();
- void setSpecifiedName(String name);
- String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- boolean isRequired();
- boolean isDefaultRequired();
- boolean DEFAULT_REQUIRED = false;
- Boolean getSpecifiedRequired();
- void setSpecifiedRequired(Boolean specifiedRequired);
- String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- String getNamespace();
- String getDefaultNamespace();
- String getSpecifiedNamespace();
- void setSpecifiedNamespace(String namespace);
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
-
-
- // ********** xml schema type ************
- /**
- * Return whether this class has an XmlSchemaType annotation)
- */
- boolean hasXmlSchemaType();
-
- /**
- * Return the xml schema type or null.
- */
- XmlSchemaType getXmlSchemaType();
-
- XmlSchemaType addXmlSchemaType();
- void removeXmlSchemaType();
- String XML_SCHEMA_TYPE = "xmlSchemaType"; //$NON-NLS-1$
-
-
- /********** XmlList **********/
- XmlList getXmlList();
- XmlList addXmlList();
- void removeXmlList();
- String XML_LIST_PROPERTY = "xmlList"; //$NON-NLS-1$
-
-
- /********** XmlID **********/
- XmlID getXmlID();
- XmlID addXmlID();
- void removeXmlID();
- String XML_ID_PROPERTY = "xmlID"; //$NON-NLS-1$
-
-
- /********** XmlIDREF **********/
- XmlIDREF getXmlIDREF();
- XmlIDREF addXmlIDREF();
- void removeXmlIDREF();
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
-
- /********** XmlAttachmentRef **********/
- XmlAttachmentRef getXmlAttachmentRef();
- XmlAttachmentRef addXmlAttachmentRef();
- void removeXmlAttachmentRef();
- String XML_ATTACHMENT_REF_PROPERTY = "xmlAttachmentRef"; //$NON-NLS-1$
-
-} \ No newline at end of file
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 65cdf850ce..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
+++ /dev/null
@@ -1,130 +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.0
- * @since 3.0
- */
-public interface JaxbContextRoot
- extends JaxbContextNode {
-
- /**
- * The set of packages. Includes any package with any interesting JAXB content.
- */
- Iterable<JaxbPackage> getPackages();
- public final static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
-
- int getPackagesSize();
-
- /**
- * Return the package with the given name
- */
- JaxbPackage getPackage(String packageName);
-
- /**
- * Return the set of all JAXB types within this context root.
- */
- Iterable<JaxbType> getTypes();
- public final static String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- int getTypesSize();
-
- /**
- * Return the type with the given name
- */
- JaxbType getType(String typeName);
-
- /**
- * Return the set of types that are in the given package
- */
- Iterable<JaxbType> getTypes(JaxbPackage jaxbPackage);
-
- /**
- * The set of persistent classes. These may be explicitly or implicitly included.
- */
- Iterable<JaxbPersistentClass> getPersistentClasses();
-
- /**
- * Return the set of persistent classes that are in the given package
- */
- Iterable<JaxbPersistentClass> getPersistentClasses(JaxbPackage jaxbPackage);
-
- /**
- * Return the persistent class with the given fully qualified name
- */
- JaxbPersistentClass getPersistentClass(String fullyQualifiedTypeName);
-
- /**
- * The set of persistent enums. These may be explicitly or implicitly included.
- */
- Iterable<JaxbPersistentEnum> getPersistentEnums();
-
- /**
- * Return the set of persistent enums that are in the given package
- */
- Iterable<JaxbPersistentEnum> getPersistentEnums(JaxbPackage jaxbPackage);
-
- /**
- * Return the persistent enum with the given fully qualified name
- */
- JaxbPersistentEnum getPersistentEnum(String fullyQualifiedTypeName);
-
- /**
- * The set of registries.
- */
- Iterable<JaxbRegistry> getRegistries();
-
- /**
- * Return the set of registries that are in the given package
- * (There should typically be a max of 1, but there are invalid states ...)
- */
- Iterable<JaxbRegistry> getRegistries(JaxbPackage jaxbPackage);
-
- /**
- * The set of transient classes.
- */
- Iterable<JaxbTransientClass> getTransientClasses();
-
- /**
- * Return the set of transient classes that are in the given package
- */
- Iterable<JaxbTransientClass> getTransientClasses(JaxbPackage jaxbPackage);
-
- /**
- * Return the transient class with the given fully qualified name
- */
- JaxbTransientClass getTransientClass(String fullyQualifiedTypeName);
-
-
- /**
- * Return the persistent class or transient type with the given fully qualified name
- */
- JaxbClass getClass(String fullyQualifiedTypeName);
-
- // **************** 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 c662f829cb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
+++ /dev/null
@@ -1,84 +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.jaxb.core.resource.java.JavaResourceMethod;
-
-/**
- * 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 JaxbContextNode {
-
- JavaResourceMethod getResourceMethod();
-
- /**
- * Return the method name
- */
- String getName();
-
- /**
- * Corresponds to the XmlElementDecl annotation 'name' element
- */
- String getElementName();
- void setElementName(String elementName);
- String ELEMENT_NAME_PROPERTY = "elementName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the XmlElementDecl annotation 'defaultValue' element
- */
- String getDefaultValue();
- void setDefaultValue(String defaultValue);
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
- String DEFAULT_DEFAULT_VALUE = "\u0000"; //$NON-NLS-1$
-
- /**
- * Corresponds to the XmlElementDecl annotation 'namespace' element
- */
- String getNamespace();
- void setNamespace(String namespace);
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
- String DEFAULT_NAMESPACE = "##default"; //$NON-NLS-1$
-
- /**
- * Corresponds to the XmlElementDecl annotation 'substitutionHeadName' element
- */
- String getSubstitutionHeadName();
- void setSubstitutionHeadName(String substitutionHeadName);
- String SUBSTIUTION_HEAD_NAME_PROPERTY = "substitutionHeadName"; //$NON-NLS-1$
- String DEFAULT_SUBSTIUTION_HEAD_NAME = ""; //$NON-NLS-1$
-
- /**
- * Corresponds to the XmlElementDecl annotation 'substitutionHeadNamespace' element
- */
- String getSubstitutionHeadNamespace();
- void setSubstitutionHeadNamespace(String substitutionHeadNamespace);
- String SUBSTIUTION_HEAD_NAMESPACE_PROPERTY = "substitutionHeadNamespace"; //$NON-NLS-1$
- String DEFAULT_SUBSTIUTION_HEAD_NAMESPACE = "##default"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the XmlElementDecl annotation 'scope' element
- */
- String getScope();
- void setScope(String scope);
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
- String DEFAULT_SCOPE_CLASS_NAME = "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"; //$NON-NLS-1$
-}
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 71d8238701..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.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.context;
-
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-
-/**
- * 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 JaxbContextNode {
-
- 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/JaxbPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
deleted file mode 100644
index e2cb4d80f1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.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.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 whether this package has no useful information.
- * Useful information includes:
- * - annotated package-info.java
- * - jaxb.index
- * - object factory
- */
- boolean isEmpty();
-
- /**
- * 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 fbf265e8d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
+++ /dev/null
@@ -1,75 +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.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-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 JaxbPackageInfo
- extends JavaContextNode, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- JavaResourcePackage getResourcePackage();
-
- JaxbPackage getParent();
-
- // ********** xml schema **********
-
- /**
- * Return the XML schema for this package info, this will not be null.
- */
- XmlSchema getXmlSchema();
-
-
- // ********** xml schema types **********
-
- ListIterable<XmlSchemaType> getXmlSchemaTypes();
- int getXmlSchemaTypesSize();
- XmlSchemaType addXmlSchemaType(int index);
- void removeXmlSchemaType(int index);
- void removeXmlSchemaType(XmlSchemaType xmlSchemaType);
- void moveXmlSchemaType(int targetIndex, int sourceIndex);
- String XML_SCHEMA_TYPES_LIST = "xmlSchemaTypes"; //$NON-NLS-1$
-
-
- // ********** xml java type adapters **********
-
- ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters();
- int getXmlJavaTypeAdaptersSize();
- XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index);
- void removeXmlJavaTypeAdapter(int index);
- void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlJavaTypeAdapter);
- void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex);
- String XML_JAVA_TYPE_ADAPTERS_LIST = "xmlJavaTypeAdapters"; //$NON-NLS-1$
-
-
- // **************** 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 9ff13cdf8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
+++ /dev/null
@@ -1,112 +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.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-
-/**
- * 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 {
-
-
- JaxbPersistentClass getParent();
-
- /**
- * Return true if this JaxbPersistentAttribute is inherited from one of the
- * superclasses of the parent JaxbPersistentClass.
- */
- boolean isInherited();
-
- /**
- * Only ask this of inherited persistent attributes. Returns the simple
- * type name of the attribute's resource type.
- *
- * @see JaxbPersistentAttribute#isInherited()
- */
- String getInheritedJavaResourceAttributeOwningTypeName();
-
- // ********** name **********
-
- /**
- * Return the name of the attribute. This will not change, a
- * new JaxbPersistentAttribute will be built if the name changes.
- */
- String getName();
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- /**
- * Return the type name of the java resource attribute
- * This might not return the same thing as getJavaResourceAttribute().getTypeName().
- */
- String getJavaResourceAttributeTypeName();
-
- /**
- * Return whether the java resource attribute type is an array
- * This might not return the same thing as getJavaResourceAttribute().typeIsArray().
- */
- boolean isJavaResourceAttributeTypeArray();
-
- /**
- * 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);
-
- // ********** 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/JaxbPersistentClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentClass.java
deleted file mode 100644
index f52f029740..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentClass.java
+++ /dev/null
@@ -1,77 +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;
-
-/**
- * Represents a JAXB persistent class.
- * (A class with either an explicit or implicit @XmlType 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 JaxbPersistentClass
- extends JaxbPersistentType, JaxbClass, XmlAdaptable {
-
- // ******** see also ************
-
- String XML_SEE_ALSO_PROPERTY = "xmlSeeAlso"; //$NON-NLS-1$
-
- XmlSeeAlso getXmlSeeAlso();
-
- XmlSeeAlso addXmlSeeAlso();
-
- void removeXmlSeeAlso();
-
-
- /********** attributes **********/
-
- Iterable<JaxbPersistentAttribute> getAttributes();
- int getAttributesSize();
- String ATTRIBUTES_COLLECTION = "attributes"; //$NON-NLS-1$
-
-
- /********** inherited attributes **********/
-
- /**
- * Inherited attributes come from any superclasses that are mapped as @XmlTransient.
- * @see JaxbClass#getSuperClass()
- * @see JaxbClass#getInheritanceHierarchy()
- */
- Iterable<JaxbPersistentAttribute> getInheritedAttributes();
- int getInheritedAttributesSize();
- String INHERITED_ATTRIBUTES_COLLECTION = "inheritedAttributes"; //$NON-NLS-1$
-
-
- /**
- * Return true if the given attribute is one of the inherited attributes.
- */
- boolean isInherited(JaxbPersistentAttribute attribute);
-
- /**
- * Only ask this of inherited persistent attributes. Returns the simple
- * type name of the attribute's resource type.
- *
- * @see JaxbPersistentAttribute#isInherited()
- */
- String getJavaResourceAttributeOwningTypeName(JaxbPersistentAttribute attribute);
-
- /**
- * Return true if 1 or more attributes include the @XmlId annotation
- */
- boolean containsXmlId();
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java
deleted file mode 100644
index 3d047e3f98..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.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.context;
-
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnum;
-
-
-/**
- * Represents a JAXB persistent enum.
- * (A enum with either an explicit or implicit @XmlEnum 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 JaxbPersistentEnum
- extends JaxbPersistentType {
-
- /**
- * covariant override
- */
- JavaResourceEnum getJavaResourceType();
-
- /**************** enum type *****************/
-
- /**
- * enum type corresponds to the XmlEnum annotation value element
- */
- String getEnumType();
- void setEnumType(String enumType);
- String ENUM_TYPE_PROPERTY = "enumType"; //$NON-NLS-1$
- String DEFAULT_ENUM_TYPE = "java.lang.String"; //$NON-NLS-1$
-
-
- /********** enum constants **********/
-
- Iterable<JaxbEnumConstant> getEnumConstants();
- int getEnumConstantsSize();
- String ENUM_CONSTANTS_COLLECTION = "enumConstants"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentField.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentField.java
deleted file mode 100644
index e87e68feae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentField.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.context;
-
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-
-/**
- * Represents a JAXB field.
- * <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 JaxbPersistentField
- extends JaxbPersistentAttribute {
-
- JavaResourceField getResourceField();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentProperty.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentProperty.java
deleted file mode 100644
index 329d44807e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentProperty.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.context;
-
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-
-/**
- * Represents a JAXB property (getter/setter pair)
- * <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 JaxbPersistentProperty
- extends JaxbPersistentAttribute {
-
- JavaResourceMethod getResourceGetterMethod();
-
- JavaResourceMethod getResourceSetterMethod();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java
deleted file mode 100644
index 9f9397967c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.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.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-/**
- * Represents a JAXB persistent type (class or enum).
- * (A class with either an explicit or implicit @XmlType 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 JaxbPersistentType
- extends JaxbType {
-
- /**************** factory class *****************/
-
- /**
- * factory class corresponds to the XmlType annotation factoryClass element
- */
- String getFactoryClass();
- void setFactoryClass(String factoryClass);
- String FACTORY_CLASS_PROPERTY = "factoryClass"; //$NON-NLS-1$
-
-
- /**************** factory method *****************/
-
- /**
- * factory method corresponds to the XmlType annotation factoryMethod element
- */
- String getFactoryMethod();
- void setFactoryMethod(String factoryMethod);
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
-
- /**************** name *****************/
-
- /**
- * Return the specified xml type name or the default type name if it is not specified
- */
- String getXmlTypeName();
-
- /**
- * Return the specified xml type name or null if it is not specified
- */
- String getSpecifiedXmlTypeName();
-
- /**
- * Set the xml type name, null to unspecify (use the default)
- */
- void setSpecifiedXmlTypeName(String xmlTypeName);
-
- /**
- * String constant associated with changes to the specified xml type name
- */
- String SPECIFIED_XML_TYPE_NAME_PROPERTY = "specifiedXmlTypeName"; //$NON-NLS-1$
-
- /**
- * Return the default xml type name
- */
- String getDefaultXmlTypeName();
-
-
- /**************** namespace *****************/
-
- /**
- * Return the specified xml type namespace or the default namespace if it is not specified
- */
- String getNamespace();
-
- /**
- * Return the specified xml type namespace or null if it is not specified
- */
- String getSpecifiedNamespace();
-
- /**
- * Set the xml type namespace, null to unspecify (use the default)
- */
- void setSpecifiedNamespace(String namespace);
-
- /**
- * String constant associated with changes to the specified xml type namespace
- */
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- /**
- * Return the default namespace
- */
- String getDefaultNamespace();
-
-
- /********** propOrder **********/
-
- /**
- * propOrder corresponds to the XmlType annotation propOrder element
- */
- ListIterable<String> getPropOrder();
- int getPropOrderSize();
- void addProp(int index, String prop);
- void removeProp(int index);
- void removeProp(String prop);
- void moveProp(int targetIndex, int sourceIndex);
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- // ********** root element ************
- /**
- * Return whether this class is a root element (has the XmlRootElement annotation)
- */
- boolean isRootElement();
-
- /**
- * Return the root element or null if it is not a root element.
- */
- XmlRootElement getRootElement();
-
- /**
- * Set the root element name, this will add the XmlRootElement annotation
- * and set its name to the specified name.
- * To remove the XmlRootElement annotation, pass in null.
- * To set the name when the class is already a root element,
- * set it directly on the XmlRootElement.
- */
- XmlRootElement setRootElement(String name);
- String ROOT_ELEMENT = "rootElement"; //$NON-NLS-1$
-
-
- // **************** misc **************************************************
-
- XsdTypeDefinition getXsdTypeDefinition();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRegistry.java
deleted file mode 100644
index 2e187c89ff..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRegistry.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.context;
-
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * 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 JaxbRegistry extends JaxbType {
-
- /**
- * covariant override
- */
- JavaResourceType getJavaResourceType();
-
-
- /********** element factory methods **********/
-
- Iterable<JaxbElementFactoryMethod> getElementFactoryMethods();
- int getElementFactoryMethodsSize();
- String ELEMENT_FACTORY_METHODS_COLLECTION = "elementFactoryMethods"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTransientClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTransientClass.java
deleted file mode 100644
index 4714a3e436..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTransientClass.java
+++ /dev/null
@@ -1,27 +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 transient JAXB type
- * (A class with an explicit @XmlTransient 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 JaxbTransientClass extends JaxbClass {
-
-}
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 1c0dfc7671..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
+++ /dev/null
@@ -1,110 +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.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-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.0
- * @since 3.0
- */
-public interface JaxbType
- extends JavaContextNode {
-
- /**
- * Return the kind of JaxbType this represents
- */
- Kind getKind();
-
- /**
- * Return the associated java resource type
- */
- JavaResourceAbstractType getJavaResourceType();
-
- /**
- * Returns the fully qualified name of this type, including qualification for any
- * enclosing types and packages.
- */
- String getFullyQualifiedName();
-
- /**
- * Returns the type-qualified name of this type, including qualification for any
- * enclosing types, but not including package qualification.
- */
- String getTypeQualifiedName();
-
- /**
- * Return the name of the type without any package or type qualifiers
- */
- String getSimpleName();
-
- /**
- * Return the name of the type's package. Empty string if none.
- */
- String getPackageName();
-
- /**
- * Return the {@link JaxbPackage} associated with this type
- */
- JaxbPackage getJaxbPackage();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getDirectlyReferencedTypeNames();
-
-
- // **************** validation ********************************************
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
-
- /**
- * The kind of metadata specified on the java type.
- */
- public static enum Kind {
-
- /**
- * A JaxbType of {@link Kind} PERSISTENT_CLASS may safely be cast as a {@link JaxbPersistentClass}
- */
- PERSISTENT_CLASS,
-
- /**
- * A JaxbType of {@link Kind} PERSISTENT_ENUM may safely be cast as a {@link JaxbPersistentEnum}
- */
- PERSISTENT_ENUM,
-
- /**
- * A JaxbType of {@link Kind} REGISTRY may safely be cast as a {@link JaxbRegistry}
- */
- REGISTRY,
-
- /**
- * A JaxbType of {@link Kind} TRANSIENT may safely be cast as a {@link JaxbTransientClass}
- */
- TRANSIENT
- }
-}
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 8110846e90..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.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;
-
-
-/**
- *
- *
- * 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();
-
- /**
- * Return the default access order, never null
- */
- XmlAccessOrder getDefaultAccessOrder();
-
- /**
- * String constant associated with changes to the default access order
- */
- String DEFAULT_ACCESS_ORDER_PROPERTY = "defaultAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the specified access order;
- */
- XmlAccessOrder getSpecifiedAccessOrder();
-
- /**
- * Set the specified access order.
- */
- void setSpecifiedAccessOrder(XmlAccessOrder newSpecifiedAccessOrder);
-
- /**
- * String constant associated with changes to the specified access order
- */
- String SPECIFIED_ACCESS_ORDER_PROPERTY = "specifiedAccessOrder"; //$NON-NLS-1$
-
-}
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 986195e690..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.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;
-
-
-/**
- *
- *
- * 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();
-
- /**
- * Return the default access type, never null
- */
- XmlAccessType getDefaultAccessType();
-
- /**
- * String constant associated with changes to the default access type
- */
- String DEFAULT_ACCESS_TYPE_PROPERTY = "defaultAccessType"; //$NON-NLS-1$
-
- /**
- * Return the specified access type;
- */
- XmlAccessType getSpecifiedAccessType();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedAccessType(XmlAccessType newSpecifiedAccessType);
-
- /**
- * String constant associated with changes to the specified access type
- */
- String SPECIFIED_ACCESS_TYPE_PROPERTY = "specifiedAccessType"; //$NON-NLS-1$
-
-}
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 d0d03b92c1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.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;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public interface XmlAdaptable
- extends JavaContextNode
-{
- /********** XmlJavaTypeAdapter **********/
- XmlJavaTypeAdapter getXmlJavaTypeAdapter();
- XmlJavaTypeAdapter addXmlJavaTypeAdapter();
- void removeXmlJavaTypeAdapter();
- String XML_JAVA_TYPE_ADAPTER_PROPERTY = "xmlJavaTypeAdapter"; //$NON-NLS-1$
-
- interface Owner {
- JavaResourceAnnotatedElement getResource();
- XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation adapterAnnotation);
- void fireXmlAdapterChanged(XmlJavaTypeAdapter oldAdapter, XmlJavaTypeAdapter newAdapter);
- }
-}
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 ee6cddc2e5..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, XmlAdaptable {
-
-}
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 1e2b502648..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.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 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, XmlAdaptable {
-
-
- boolean isLax();
- boolean isDefaultLax();
- boolean DEFAULT_LAX = false;
- Boolean getSpecifiedLax();
- void setSpecifiedLax(Boolean specifiedLax);
- String SPECIFIED_LAX_PROPERTY = "specifiedLax"; //$NON-NLS-1$
-
- /**************** value *****************/
-
- String getValue();
- String getDefaultValue();
- String DEFAULT_TYPE_PROPERTY = "defaultValue"; //$NON-NLS-1$
- String getSpecifiedValue();
- void setSpecifiedValue(String value);
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
- String DEFAULT_VALUE = "javax.xml.bind.annotation.W3CDomHandler"; //$NON-NLS-1$
-
- /********** XmlMixed **********/
- XmlMixed getXmlMixed();
- XmlMixed addXmlMixed();
- void removeXmlMixed();
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
-}
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 63b5648f61..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.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 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 JaxbContainmentMapping {
-
-}
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 c34a8ee7e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.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 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 JaxbContainmentMapping {
-
-
- boolean isNillable();
- boolean isDefaultNillable();
- boolean DEFAULT_NILLABLE = false;
- Boolean getSpecifiedNillable();
- void setSpecifiedNillable(Boolean specifiedNillable);
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- String getDefaultValue();
- void setDefaultValue(String defaultValue);
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getType();
- String getDefaultType();
- String getSpecifiedType();
- void setSpecifiedType(String type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
-
- /********** XmlElementWrapper **********/
- XmlElementWrapper getXmlElementWrapper();
- XmlElementWrapper addXmlElementWrapper();
- void removeXmlElementWrapper();
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
-} \ No newline at end of file
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 527cd593ad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
+++ /dev/null
@@ -1,56 +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 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 {
-
-
- String getName();
- String getDefaultName();
- String getSpecifiedName();
- void setSpecifiedName(String name);
- String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- String getNamespace();
- String getDefaultNamespace();
- String getSpecifiedNamespace();
- void setSpecifiedNamespace(String namespace);
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- boolean isNillable();
- boolean isDefaultNillable();
- boolean DEFAULT_NILLABLE = false;
- Boolean getSpecifiedNillable();
- void setSpecifiedNillable(Boolean specifiedNillable);
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- boolean isRequired();
- boolean isDefaultRequired();
- boolean DEFAULT_REQUIRED = false;
- Boolean getSpecifiedRequired();
- void setSpecifiedRequired(Boolean specifiedRequired);
- String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-} \ No newline at end of file
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 d5f9db3d99..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.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 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 72581acdc0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.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 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 ed84284df4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.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.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.0
- * @since 3.0
- */
-public interface XmlJavaTypeAdapter
- extends JavaContextNode {
-
- XmlJavaTypeAdapterAnnotation getResourceXmlJavaTypeAdapter();
-
- /**************** value *****************/
-
- String getValue();
-
- void setValue(String value);
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**************** type *****************/
-
- String getType();
- String getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- String getSpecifiedType();
- void setSpecifiedType(String type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
- 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/XmlList.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.java
deleted file mode 100644
index 70e1fc55e3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlList.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 XML list
- * <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 XmlList
- 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/XmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
deleted file mode 100644
index 859a755a0c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.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;
-
-/**
- *
- * <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/XmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
deleted file mode 100644
index c83049ccc9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.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.context;
-
-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
- JaxbContextNode
-{
- XmlNsAnnotation getResourceXmlNs();
-
- // ********** namespaceURI **********
- String getNamespaceURI();
- void setNamespaceURI(String namespaceURI);
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- // ********** prefix **********
- String getPrefix();
- void setPrefix(String prefix);
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-}
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/XmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
deleted file mode 100644
index 12870d5571..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
+++ /dev/null
@@ -1,84 +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.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB xml root element.
- * (A class with either 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 {
-
- /**************** name *****************/
-
- /**
- * Return the specified name or the default type name if it is not specified
- */
- String getName();
-
- /**
- * Return the specified name or null if it is not specified
- */
- String getSpecifiedName();
-
- /**
- * Set the name, null to unspecify (use the default)
- */
- void setSpecifiedName(String name);
-
- /**
- * String constant associated with changes to the specified name
- */
- String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- /**
- * Return the default name
- */
- String getDefaultName();
-
-
- /**************** namespace *****************/
-
- /**
- * Return the specified namespace or the default namespace if it is not specified
- */
- String getNamespace();
-
- /**
- * Return the specified namespace or null if it is not specified
- */
- String getSpecifiedNamespace();
-
- /**
- * Set the namespace, null to unspecify (use the default)
- */
- void setSpecifiedNamespace(String namespace);
-
- /**
- * String constant associated with changes to the specified namespace
- */
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- /**
- * Return the default namespace
- */
- String getDefaultNamespace();
-}
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 6bf74005b9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
+++ /dev/null
@@ -1,88 +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.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 {
-
- /**
- * 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$
-
-
- /**
- * Corresponds to the XmlSchema annotation 'attributeFormDefault' element
- */
- XmlNsForm getAttributeFormDefault();
- void setAttributeFormDefault(XmlNsForm newAttributeFormDefault);
- String ATTRIBUTE_FROM_DEFAULT_PROPERTY = "atributeFormDefault"; //$NON-NLS-1$
- XmlNsForm DEFAULT_ATTRIBUTE_FORM_DEFAULT = XmlNsForm.UNSET;
-
-
- /**
- * Corresponds to the XmlSchema annotation 'elementFormDefault' element
- */
- XmlNsForm getElementFormDefault();
- void setElementFormDefault(XmlNsForm newElementFormDefault);
- String ELEMENT_FROM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
- XmlNsForm DEFAULT_ELEMENT_FORM_DEFAULT = XmlNsForm.UNSET;
-
-
- // ********** 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 f2fb6625ab..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
+++ /dev/null
@@ -1,64 +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;
-
-/**
- *
- * <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 XmlSchemaType
- extends
- JavaContextNode
-{
-
- XmlSchemaTypeAnnotation getResourceXmlSchemaType();
-
-
- /**************** name *****************/
-
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
-
- /**************** namespace *****************/
-
- /**
- * Corresponds to the XmlSchemaType annotation 'namespace' element
- */
- String getNamespace();
- String getDefaultNamespace();
- String getSpecifiedNamespace();
- void setSpecifiedNamespace(String namespace);
- String SPECIFIED_NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
- String DEFAULT_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
-
-
- /**************** type *****************/
-
- /**
- * Corresponds to the XmlSchemaType annotation 'type' element
- */
- String getType();
- void setType(String type);
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT"; //$NON-NLS-1$
-}
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 7a02e5f6d9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.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.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 **************************************************
-
- Iterable<String> getDirectlyReferencedTypeNames();
-}
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 49b7509633..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.0
- * @since 3.0
- */
-public interface XmlValueMapping
- extends JaxbAttributeMapping, XmlAdaptable {
-
-} \ 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 d1266ee1bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
+++ /dev/null
@@ -1,182 +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.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.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-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.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentType;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass;
-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.XmlNs;
-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.GenericJavaElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumConstant;
-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.GenericJavaPersistentClass;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPersistentEnum;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPersistentField;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPersistentProperty;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaRegistry;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaTransientClass;
-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.GenericJavaXmlNs;
-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.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-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 JaxbRegistry buildRegistry(JaxbContextRoot parent, JavaResourceType resourceType) {
- return new GenericJavaRegistry(parent, resourceType);
- }
-
- public JaxbTransientClass buildJavaTransientClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- return new GenericJavaTransientClass(parent, resourceType);
- }
-
- public JaxbPersistentClass buildJavaPersistentClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- return new GenericJavaPersistentClass(parent, resourceType);
- }
-
- public JaxbPersistentEnum buildJavaPersistentEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum) {
- return new GenericJavaPersistentEnum(parent, resourceEnum);
- }
-
- public XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent) {
- return new GenericJavaXmlSchema(parent);
- }
-
- public JaxbEnumConstant buildJavaEnumConstant(JaxbPersistentEnum parent, JavaResourceEnumConstant resourceEnumConstant) {
- return new GenericJavaEnumConstant(parent, resourceEnumConstant);
- }
-
- public XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- return new GenericJavaXmlNs(parent, xmlNsAnnotation);
- }
-
- public XmlRootElement buildJavaXmlRootElement(JaxbPersistentType parent, XmlRootElementAnnotation xmlRootElementAnnotation) {
- return new GenericJavaXmlRootElement(parent, xmlRootElementAnnotation);
- }
-
- public JaxbElementFactoryMethod buildJavaElementFactoryMethod(JaxbRegistry parent, JavaResourceMethod resourceMethod) {
- return new GenericJavaElementFactoryMethod(parent, resourceMethod);
- }
-
- public JaxbPersistentField buildJavaPersistentField(JaxbPersistentClass parent, JavaResourceField resourceField) {
- return new GenericJavaPersistentField(parent, resourceField);
- }
-
- public JaxbPersistentProperty buildJavaPersistentProperty(JaxbPersistentClass parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return new GenericJavaPersistentProperty(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 XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlValueMapping(parent);
- }
-}
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 84dcf57c39..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
+++ /dev/null
@@ -1,498 +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.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.core.runtime.Platform;
-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")
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().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();
- this.initializeContextElements();
- }
-
- /**
- * 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();
-
- protected void initializeContextElements() {
- 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 contextElementAt(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.contextElementAt(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 contextElementAt(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());
- }
- }
-}
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 738774eaa7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.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;
-
-import java.util.ArrayList;
-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;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-/**
- * 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 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();
- }
-
-
- // ********** 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 dd87607d47..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
+++ /dev/null
@@ -1,1602 +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.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.ResourceLocator;
-import org.eclipse.jpt.common.utility.Command;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.ThreadLocalCommandExecutor;
-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.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType.Kind;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-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 ThreadLocalCommandExecutor 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 ThreadLocalCommandExecutor buildModifySharedDocumentCommandExecutor() {
- return new ThreadLocalCommandExecutor();
- }
-
- 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 (! isInAcceptableResourceLocation(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 isInAcceptableResourceLocation(IFile file) {
- ResourceLocator resourceLocator = JptCommonCorePlugin.getResourceLocator(getProject());
- return resourceLocator.acceptResourceLocation(getProject(), file.getParent());
- }
-
- /**
- * 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, 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());
-// }
-
-
- // ********** 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();
- }
- validateLibraryProvider(messages);
- this.contextRoot.validate(messages, reporter);
- }
-
- protected void validateLibraryProvider(List<IMessage> messages) {
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(getProject());
- 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));
- }
- }
- catch (CoreException ce) {
- // fall through
- JptJaxbCorePlugin.log(ce);
- }
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.contextModelSynchronizer.stop();
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- // 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(CommandExecutor commandExecutor) {
- this.modifySharedDocumentCommandExecutor.set(commandExecutor);
- }
-
- public CommandExecutor 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/GenericAnnotationProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java
deleted file mode 100644
index 32f447deff..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java
+++ /dev/null
@@ -1,128 +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.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.AnnotationProvider;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-/**
- * Delegate to annotation definition providers.
- * The platform factory will build an instance of this annotation provider,
- * passing in the appropriate array of annotation definition providers necessary
- * to build the annotations for the platform (vendor and/or version).
- */
-public final class GenericAnnotationProvider
- implements AnnotationProvider
-{
- private final AnnotationDefinition[] annotationDefinitions;
-
- private final NestableAnnotationDefinition[] nestableAnnotationDefinitions;
-
- public GenericAnnotationProvider(AnnotationDefinition[] annotationDefinitions, NestableAnnotationDefinition[] nestableAnnotationDefinitions) {
- super();
- this.annotationDefinitions = annotationDefinitions;
- this.nestableAnnotationDefinitions = nestableAnnotationDefinitions;
- }
-
-
- protected Iterable<AnnotationDefinition> getAnnotationDefinitions() {
- return new ArrayIterable<AnnotationDefinition>(this.annotationDefinitions);
- }
-
- protected AnnotationDefinition getAnnotationDefinition(String annotationName) {
- for (AnnotationDefinition annotationDefinition : this.annotationDefinitions) {
- if (annotationDefinition.getAnnotationName().equals(annotationName)) {
- return annotationDefinition;
- }
- }
- return null;
- }
-
- public Iterable<String> getAnnotationNames() {
- return new TransformationIterable<AnnotationDefinition, String>(getAnnotationDefinitions()) {
- @Override
- protected String transform(AnnotationDefinition annotationDefinition) {
- return annotationDefinition.getAnnotationName();
- }
- };
- }
-
- public Iterable<String> getContainerAnnotationNames() {
- return new TransformationIterable<NestableAnnotationDefinition, String>(getNestableAnnotationDefinitions()) {
- @Override
- protected String transform(NestableAnnotationDefinition annotationDefinition) {
- return annotationDefinition.getContainerAnnotationName();
- }
- };
- }
-
- public Iterable<String> getNestableAnnotationNames() {
- return new TransformationIterable<NestableAnnotationDefinition, String>(getNestableAnnotationDefinitions()) {
- @Override
- protected String transform(NestableAnnotationDefinition annotationDefinition) {
- return annotationDefinition.getNestableAnnotationName();
- }
- };
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName) {
- return this.getAnnotationDefinition(annotationName).buildAnnotation(parent, element);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return this.getAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent, String annotationName) {
- return this.getAnnotationDefinition(annotationName).buildNullAnnotation(parent);
- }
-
- protected Iterable<NestableAnnotationDefinition> getNestableAnnotationDefinitions() {
- return new ArrayIterable<NestableAnnotationDefinition>(this.nestableAnnotationDefinitions);
- }
-
- protected NestableAnnotationDefinition getNestableAnnotationDefinition(String annotationName) {
- for (NestableAnnotationDefinition annotationDefinition : this.nestableAnnotationDefinitions) {
- if (annotationDefinition.getNestableAnnotationName().equals(annotationName)) {
- return annotationDefinition;
- }
- }
- return null;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, String annotationName, int index) {
- return this.getNestableAnnotationDefinition(annotationName).buildAnnotation(parent, element, index);
- }
-
- public String getNestableAnnotationName(String containerAnnotationName) {
- return getNestableAnnotationDefinitionForContainer(containerAnnotationName).getNestableAnnotationName();
- }
-
- public String getNestableElementName(String nestableAnnotationName) {
- return getNestableAnnotationDefinition(nestableAnnotationName).getElementName();
- }
-
- private NestableAnnotationDefinition getNestableAnnotationDefinitionForContainer(String containerAnnotationName) {
- for (NestableAnnotationDefinition nestableAnnotationDefinition : getNestableAnnotationDefinitions()) {
- if (nestableAnnotationDefinition.getContainerAnnotationName().equals(containerAnnotationName)) {
- return nestableAnnotationDefinition;
- }
- }
- return null;
- }
-}
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/JavaPackageInfoResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
deleted file mode 100644
index 82042f5140..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.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.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-
-/**
- * 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) {
- return new SourcePackageInfoCompilationUnit(
- 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/JavaResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
deleted file mode 100644
index f59a77992e..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.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-
-/**
- * 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/JaxbPlatformTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JaxbPlatformTester.java
deleted file mode 100644
index 6cd7bda963..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JaxbPlatformTester.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.internal;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-
-public class JaxbPlatformTester
- extends PropertyTester {
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (! (property.equals("jaxbPlatform") || property.equals("jaxbPlatformGroup"))
- || ! (expectedValue instanceof String)) { //$NON-NLS-1$
- return false;
- }
-
- JaxbPlatformDescription platform = null;
-
- if (receiver instanceof IResource) {
- platform = platform(((IResource) receiver).getProject());
- }
- else if (receiver instanceof IJavaElement) {
- platform = platform(((IJavaElement) receiver).getResource().getProject());
- }
- else if (receiver instanceof JaxbPlatformDescription) {
- platform = (JaxbPlatformDescription) receiver;
- }
- else if (receiver instanceof JaxbLibraryProviderInstallOperationConfig) {
- platform = ((JaxbLibraryProviderInstallOperationConfig) receiver).getJaxbPlatform();
- }
-
- if (property.equals("jaxbPlatform")) {
- JaxbPlatformDescription otherPlatform = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform((String) expectedValue);
- return platform == null ? false : platform.equals(otherPlatform);
- }
- if (property.equals("jaxbPlatformGroup")) {
- JaxbPlatformGroupDescription group = (platform == null) ? null : platform.getGroup();
- JaxbPlatformGroupDescription otherGroup = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup((String) expectedValue);
- return group == null ? false : group.equals(otherGroup);
- }
- return false;
- }
-
- private JaxbPlatformDescription platform(IProject project) {
- return (project == null)
- ? null
- : JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(JptJaxbCorePlugin.getJaxbPlatformId(project));
- }
-}
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 b8dd9e9dfb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
+++ /dev/null
@@ -1,44 +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 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_invalidJreJaxbVersion;
-
- public static String PREFERENCES_FLUSH_JOB_NAME;
-
- public static String SchemaGenerator_creatingJAXBPropertiesFileTask;
-
-
- 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/SchemaLibraryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
deleted file mode 100644
index cc9f954415..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
+++ /dev/null
@@ -1,122 +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.HashMap;
-import java.util.Map;
-import org.eclipse.emf.common.notify.Adapter;
-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.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-public class SchemaLibraryImpl
- implements SchemaLibrary {
-
- private JaxbProject project;
-
- private final Map<String, String> schemaLocations;
-
- private final Map<String, XSDResourceImpl> schemaResources;
-
- private Adapter schemaResourceAdapter = new SchemaResourceAdapter();
-
-
- SchemaLibraryImpl(JaxbProject project) {
- this.project = project;
- this.schemaLocations = new HashMap<String, String>();
- this.schemaResources = new HashMap<String, XSDResourceImpl>();
- readProjectPreferences();
- }
-
-
- public XSDSchema getSchema(String namespace) {
- String resolvedUri = getResolvedUri(namespace);
- if (resolvedUri == null) {
- return null;
- }
-
- XSDResourceImpl schemaResource = this.schemaResources.get(namespace);
- XSDSchema schema = (schemaResource == null) ? null : schemaResource.getSchema();
- if (schemaResource != null) {
- if (schema != null && schemaResource.getURI().toString().equals(resolvedUri) && schemaResource.isLoaded()) {
- return schema;
- }
- else {
- removeSchemaResource(namespace, schemaResource);
- }
- }
-
- return addSchema(namespace, resolvedUri);
- }
-
- protected String getResolvedUri(String namespace) {
- String location = this.schemaLocations.get(namespace);
- return XsdUtil.getResolvedUri(namespace, location);
- }
-
- protected XSDSchema addSchema(String namespace, String resolvedUri) {
- XSDSchema schema = XsdUtil.buildXSDModel(resolvedUri);
- XSDResourceImpl schemaResource = (XSDResourceImpl) schema.eResource();
- if (schemaResource != null) {
- schemaResource.eAdapters().add(this.schemaResourceAdapter);
- this.schemaResources.put(namespace, schemaResource);
- return schema;
- }
- return null;
- }
-
- protected void removeSchemaResource(XSDResourceImpl schemaResource) {
- for (String namespace : this.schemaResources.keySet()) {
- if (schemaResource.equals(this.schemaResources.get(namespace))) {
- removeSchemaResource(namespace, schemaResource);
- }
- }
- }
-
- protected void removeSchemaResource(String namespace, XSDResourceImpl schemaResource) {
- schemaResource.eAdapters().remove(this.schemaResourceAdapter);
- this.schemaResources.remove(namespace);
- }
-
- protected void readProjectPreferences() {
- Map<String, String> schemaMap = JptJaxbCorePlugin.getSchemaLocationMap(this.project.getProject());
- this.schemaLocations.putAll(schemaMap);
- }
-
- public Map<String, String> getSchemaLocations() {
- return Collections.unmodifiableMap(this.schemaLocations);
- }
-
- public void setSchemaLocations(Map<String, String> schemaLocations) {
- this.schemaLocations.clear();
- JptJaxbCorePlugin.setSchemaLocationMap(this.project.getProject(), schemaLocations);
- readProjectPreferences();
- }
-
-
- private class SchemaResourceAdapter
- extends AdapterImpl {
-
- @Override
- public void notifyChanged(Notification msg) {
- if (msg.getFeatureID(Resource.class) == Resource.RESOURCE__IS_LOADED
- && msg.getNewBooleanValue() == false) {
- removeSchemaResource((XSDResourceImpl) msg.getNotifier());
- }
- }
- }
-}
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 e4a5a02261..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
+++ /dev/null
@@ -1,87 +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.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/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 5b61923364..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
+++ /dev/null
@@ -1,623 +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.HashMap;
-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.utility.internal.ClassName;
-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.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.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * the context model root
- */
-public class GenericContextRoot
- 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 GenericContextRoot(JaxbProject jaxbProject) {
- super(null); // the JAXB project is not really a "parent"...
- if (jaxbProject == null) {
- throw new NullPointerException();
- }
- this.jaxbProject = jaxbProject;
- this.packages = new HashMap<String, JaxbPackage>();
- this.types = new HashMap<String, JaxbType>();
- initialize();
- }
-
-
- @Override
- public JaxbContextRoot getContextRoot() {
- return this;
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- protected void initialize() {
- // 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));
- }
-
- // process registry classes before other classes (they are completely determined by annotation)
- for (JavaResourceType registryResourceType : calculateRegistries()) {
- String className = registryResourceType.getQualifiedName();
- totalTypes.add(className);
- typesToScan.add(className);
- this.types.put(registryResourceType.getName(), buildRegistry(registryResourceType));
- }
-
- // calculate initial set of persistent types (annotated with @XmlType)
- final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialPersistentTypes();
-
- // 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);
- JaxbType.Kind jaxbTypeKind = calculateJaxbTypeKind(resourceType);
- this.types.put(resourceType.getName(), buildType(jaxbTypeKind, resourceType));
- resourceTypesToProcess.remove(resourceType);
- }
-
- for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
- JaxbType jaxbType = getType(typeToScan);
- if (jaxbType != null) {
- for (String referencedTypeName : jaxbType.getDirectlyReferencedTypeNames()) {
- 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));
- }
- }
-
- // process registry classes before other classes (they are completely determined by annotation)
- for (JavaResourceType registryResourceType : calculateRegistries()) {
- String className = registryResourceType.getQualifiedName();
- typesToRemove.remove(className);
- totalTypes.add(className);
- typesToScan.add(className);
- if (this.types.containsKey(className)) {
- if (this.types.get(className).getKind() == JaxbType.Kind.REGISTRY) {
- typesToUpdate.add(className);
- }
- else {
- this.removeType(className); // this will remove a type of another kind
- this.addType(buildRegistry(registryResourceType));
- }
- }
- else {
- this.addType(buildRegistry(registryResourceType));
- }
- }
-
- // calculate initial set of persistent types (annotated with @XmlType)
- final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialPersistentTypes();
-
- // 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);
- resourceTypesToProcess.remove(resourceType);
- }
-
- for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
- JaxbType jaxbType = getType(typeToScan);
- if (jaxbType != null) {
- for (String referencedTypeName : jaxbType.getDirectlyReferencedTypeNames()) {
- if (! StringTools.stringIsEmpty(referencedTypeName) && ! 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)) {
- 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) {
- packageNames.add(ClassName.getPackageName(typeName));
- }
- return packageNames;
- }
-
- /*
- * Calculate set of registries
- * (this should be all resource types with the @XmlRegistry annotation)
- */
- protected Set<JavaResourceType> calculateRegistries() {
- return CollectionTools.set(
- new SubIterableWrapper<JavaResourceAbstractType, JavaResourceType>(
- new FilteringIterable<JavaResourceAbstractType>(
- getJaxbProject().getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType o) {
- return o.getKind() == JavaResourceAbstractType.Kind.TYPE
- && o.getAnnotation(JAXB.XML_REGISTRY) != null;
- }
- }));
- }
-
- /*
- * Calculate set of resource types annotated with @XmlType (and not @XmlRegistry)
- */
- protected Set<JavaResourceAbstractType> calculateInitialPersistentTypes() {
- return CollectionTools.set(
- new FilteringIterable<JavaResourceAbstractType>(getJaxbProject().getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType o) {
- return o.getAnnotation(JAXB.XML_TYPE) != null && o.getAnnotation(JAXB.XML_REGISTRY) == null;
- }
- });
- }
-
- protected void processType(JavaResourceAbstractType resourceType, Set<String> typesToUpdate) {
- JaxbType.Kind jaxbTypeKind = calculateJaxbTypeKind(resourceType);
- String className = resourceType.getQualifiedName();
-
- if (this.types.containsKey(className)) {
- if (this.types.get(className).getKind() == jaxbTypeKind) {
- typesToUpdate.add(className);
- return;
- }
- else {
- this.removeType(className); // this will remove a type of another kind
- }
- }
-
- this.addType(buildType(jaxbTypeKind, resourceType));
- }
-
- protected JaxbType.Kind calculateJaxbTypeKind(JavaResourceAbstractType resourceType) {
- if (resourceType.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- return JaxbType.Kind.PERSISTENT_ENUM;
- }
- // else is of kind TYPE
- else if (resourceType.getAnnotation(JAXB.XML_REGISTRY) != null) {
- return JaxbType.Kind.REGISTRY;
- }
- else if (resourceType.getAnnotation(JAXB.XML_TRANSIENT) != null) {
- return JaxbType.Kind.TRANSIENT;
- }
- else {
- return JaxbType.Kind.PERSISTENT_CLASS;
- }
- }
-
- protected JaxbType buildType(JaxbType.Kind jaxbTypeKind, JavaResourceAbstractType resourceType) {
- if (jaxbTypeKind == JaxbType.Kind.PERSISTENT_ENUM) {
- return buildPersistentEnum((JavaResourceEnum) resourceType);
- }
- else if (jaxbTypeKind == JaxbType.Kind.REGISTRY) {
- return buildRegistry((JavaResourceType) resourceType);
- }
- else if (jaxbTypeKind == JaxbType.Kind.TRANSIENT) {
- return buildTransientClass((JavaResourceType) resourceType);
- }
- else {
- return buildPersistentClass((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 this.types.get(typeName);
- }
-
- protected void addType(JaxbType type) {
- if (this.types.containsKey(type.getFullyQualifiedName())) {
- throw new IllegalArgumentException("Type with that name already exists."); //$NON-NLS-1$
- }
- this.types.put(type.getFullyQualifiedName(), 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());
- }
- };
- }
-
-
- // ********** registries **********
-
- public Iterable<JaxbRegistry> getRegistries() {
- return new SubIterableWrapper<JaxbType, JaxbRegistry>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.REGISTRY;
- }
- });
- }
-
- protected JaxbRegistry buildRegistry(JavaResourceType resourceType) {
- return this.getFactory().buildRegistry(this, resourceType);
- }
-
- public Iterable<JaxbRegistry> getRegistries(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbRegistry>(getRegistries()) {
- @Override
- protected boolean accept(JaxbRegistry o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
-
- // ********** transient types **********
-
- public Iterable<JaxbTransientClass> getTransientClasses() {
- return new SubIterableWrapper<JaxbType, JaxbTransientClass>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.TRANSIENT;
- }
- });
- }
-
- protected JaxbTransientClass buildTransientClass(JavaResourceType resourceType) {
- return this.getFactory().buildJavaTransientClass(this, resourceType);
- }
-
- public Iterable<JaxbTransientClass> getTransientClasses(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbTransientClass>(getTransientClasses()) {
- @Override
- protected boolean accept(JaxbTransientClass o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
- public JaxbTransientClass getTransientClass(String className) {
- for (JaxbTransientClass jaxbClass : this.getTransientClasses()) {
- if (StringTools.stringsAreEqual(jaxbClass.getFullyQualifiedName(), className)) {
- return jaxbClass;
- }
- }
- return null;
- }
-
- // ********** persistent classes **********
-
- public Iterable<JaxbPersistentClass> getPersistentClasses() {
- return new SubIterableWrapper<JaxbType, JaxbPersistentClass>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.PERSISTENT_CLASS;
- }
- });
- }
-
- protected JaxbPersistentClass buildPersistentClass(JavaResourceType resourceType) {
- return this.getFactory().buildJavaPersistentClass(this, resourceType);
- }
-
- public Iterable<JaxbPersistentClass> getPersistentClasses(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbPersistentClass>(getPersistentClasses()) {
- @Override
- protected boolean accept(JaxbPersistentClass o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
- public JaxbPersistentClass getPersistentClass(String className) {
- for (JaxbPersistentClass jaxbClass : this.getPersistentClasses()) {
- if (StringTools.stringsAreEqual(jaxbClass.getFullyQualifiedName(), className)) {
- return jaxbClass;
- }
- }
- return null;
- }
-
- public JaxbClass getClass(String fullyQualifiedTypeName) {
- JaxbPersistentClass jaxbClass= this.getPersistentClass(fullyQualifiedTypeName);
- return jaxbClass != null ? jaxbClass : this.getTransientClass(fullyQualifiedTypeName);
- }
-
- // ********** persistent enums **********
-
- public Iterable<JaxbPersistentEnum> getPersistentEnums() {
- return new SubIterableWrapper<JaxbType, JaxbPersistentEnum>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.PERSISTENT_ENUM;
- }
- });
- }
-
- protected JaxbPersistentEnum buildPersistentEnum(JavaResourceEnum resourceEnum) {
- return this.getFactory().buildJavaPersistentEnum(this, resourceEnum);
- }
-
- public Iterable<JaxbPersistentEnum> getPersistentEnums(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbPersistentEnum>(getPersistentEnums()) {
- @Override
- protected boolean accept(JaxbPersistentEnum o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
- public JaxbPersistentEnum getPersistentEnum(String enumName) {
- for (JaxbPersistentEnum jaxbEnum : this.getPersistentEnums()) {
- if (StringTools.stringsAreEqual(jaxbEnum.getFullyQualifiedName(), enumName)) {
- return jaxbEnum;
- }
- }
- return null;
- }
-
- @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/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 a695005640..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
+++ /dev/null
@@ -1,132 +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.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.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-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;
-import org.eclipse.xsd.XSDSchema;
-
-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;
- }
-
-
- // **************** misc **************************************************
-
- public String getNamespace() {
- return (getPackageInfo() == null) ? "" : getPackageInfo().getXmlSchema().getNamespace();
- }
-
- public XsdSchema getXsdSchema() {
- XSDSchema emfSchema = getJaxbProject().getSchemaLibrary().getSchema(getNamespace());
- return (emfSchema == null) ? null : (XsdSchema) XsdUtil.getAdapter(emfSchema);
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (! getJaxbProject().getSchemaLibrary().getSchemaLocations().containsKey(getNamespace())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.PACKAGE_NO_SCHEMA_FOR_NAMESPACE,
- new String[] {getNamespace(), this.name},
- this));
- }
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- 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/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 81652f0c96..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.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.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.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-
-public abstract class AbstractJavaAttributeMapping<A extends Annotation>
- extends AbstractJavaContextNode
- implements JaxbAttributeMapping
-{
-
- protected boolean default_;
-
- protected AbstractJavaAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.default_ = this.buildDefault();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.updateDefault();
- }
-
-
- // ********** annotation **********
-
- @SuppressWarnings("unchecked")
- public A getMappingAnnotation() {
- return (A) this.getAnnotation_();
- }
-
- protected Annotation getAnnotation_() {
- return this.getJavaResourceAttribute().getAnnotation(this.getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- /**
- * This method should only be called on mappings that can occur by default
- * (e.g. <code>XmlElement</code>).
- */
- public A getAnnotationForUpdate() {
- A annotation = this.getMappingAnnotation();
- if (annotation == null) {
- this.getPersistentAttribute().setMappingKey(this.getKey());
- annotation = this.getMappingAnnotation();
- 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 updateDefault() {
- this.setDefault(this.buildDefault());
- }
-
- protected boolean buildDefault() {
- return this.getMappingAnnotation() == null;
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation_() == null ? getJavaResourceAttribute().getNameTextRange(astRoot) : getAnnotation_().getTextRange(astRoot);
- }
-
-
- // ********** misc **********
-
- @Override
- public JaxbPersistentAttribute getParent() {
- return (JaxbPersistentAttribute) super.getParent();
- }
-
- public JaxbPersistentAttribute getPersistentAttribute() {
- return this.getParent();
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getPersistentAttribute().getJavaResourceAttribute();
- }
-
- public String getJavaResourceAttributeType() {
- return this.getPersistentAttribute().getJavaResourceAttributeTypeName();
- }
-
- public String getAttributeTypeName() {
- return getJavaResourceAttributeType();
- }
-
- public Iterable<String> getDirectlyReferencedTypeNames() {
- return new SingleElementIterable(getPersistentAttribute().getJavaResourceAttributeTypeName());
- }
-}
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/AbstractJavaPersistentType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaPersistentType.java
deleted file mode 100644
index 718a9bb839..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaPersistentType.java
+++ /dev/null
@@ -1,431 +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.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-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.JaxbPersistentType;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-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 AbstractJavaPersistentType
- extends AbstractJavaType
- implements JaxbPersistentType {
-
- protected String factoryClass;
- protected String factoryMethod;
- protected String specifiedXmlTypeName;
- protected String specifiedNamespace;
- protected final PropOrderContainer propOrderContainer;
-
- protected XmlRootElement rootElement;
-
- public AbstractJavaPersistentType(JaxbContextRoot parent, JavaResourceAbstractType resourceType) {
- super(parent, resourceType);
- this.factoryClass = this.getResourceFactoryClass();
- this.factoryMethod = this.getResourceFactoryMethod();
- this.specifiedXmlTypeName = this.getResourceXmlTypeName();
- this.specifiedNamespace = this.getResourceNamespace();
- this.propOrderContainer = new PropOrderContainer();
- this.rootElement = this.buildRootElement();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) super.getParent();
- }
-
- protected JaxbPackageInfo getPackageInfo() {
- JaxbPackage jaxbPackage = getParent().getPackage(this.getPackageName());
- return jaxbPackage == null ? null : jaxbPackage.getPackageInfo();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setFactoryClass_(getResourceFactoryClass());
- this.setFactoryMethod_(getResourceFactoryMethod());
- this.setSpecifiedXmlTypeName_(getResourceXmlTypeName());
- this.setSpecifiedNamespace_(getResourceNamespace());
- this.syncPropOrder();
- this.syncRootElement();
- }
-
-
- // ********** xml type annotation **********
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) this.getJavaResourceType().getNonNullAnnotation(XmlTypeAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** factory class **********
-
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- this.getXmlTypeAnnotation().setFactoryClass(factoryClass);
- this.setFactoryClass_(factoryClass);
- }
-
- protected void setFactoryClass_(String factoryClass) {
- String old = this.factoryClass;
- this.factoryClass = factoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, factoryClass);
- }
-
- protected String getResourceFactoryClass() {
- return this.getXmlTypeAnnotation().getFactoryClass();
- }
-
- // ********** factory method **********
-
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- this.getXmlTypeAnnotation().setFactoryMethod(factoryMethod);
- this.setFactoryMethod_(factoryMethod);
- }
-
- protected void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- protected String getResourceFactoryMethod() {
- return this.getXmlTypeAnnotation().getFactoryMethod();
- }
-
- // ********** name **********
-
- public String getXmlTypeName() {
- return (this.specifiedXmlTypeName != null) ? this.specifiedXmlTypeName : getDefaultXmlTypeName();
- }
-
- public String getSpecifiedXmlTypeName() {
- return this.specifiedXmlTypeName;
- }
-
- public void setSpecifiedXmlTypeName(String xmlTypeName) {
- this.getXmlTypeAnnotation().setName(xmlTypeName);
- this.setSpecifiedXmlTypeName_(xmlTypeName);
- }
-
- protected void setSpecifiedXmlTypeName_(String xmlTypeName) {
- String old = this.specifiedXmlTypeName;
- this.specifiedXmlTypeName = xmlTypeName;
- this.firePropertyChanged(SPECIFIED_XML_TYPE_NAME_PROPERTY, old, xmlTypeName);
- }
-
- public String getDefaultXmlTypeName() {
- return Introspector.decapitalize(getSimpleName());
- }
-
- protected String getResourceXmlTypeName() {
- return this.getXmlTypeAnnotation().getName();
- }
-
-
- // ********** namespace **********
-
- public String getNamespace() {
- return (this.specifiedNamespace != null) ? this.specifiedNamespace : getDefaultNamespace();
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String namespace) {
- this.getXmlTypeAnnotation().setNamespace(namespace);
- this.setSpecifiedNamespace_(namespace);
- }
-
- protected void setSpecifiedNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
- }
-
- public String getDefaultNamespace() {
- return getJaxbPackage().getNamespace();
- }
-
- protected String getResourceNamespace() {
- return this.getXmlTypeAnnotation().getNamespace();
- }
-
-
- // ********** prop order **********
-
- public ListIterable<String> getPropOrder() {
- return this.propOrderContainer.getContextElements();
- }
-
- 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 syncPropOrder() {
- this.propOrderContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<String> getResourcePropOrder() {
- return this.getXmlTypeAnnotation().getPropOrder();
- }
-
- // *************** root element *********************
-
- public XmlRootElement getRootElement() {
- return this.rootElement;
- }
-
- public boolean isRootElement() {
- return this.rootElement != null;
- }
-
- public XmlRootElement setRootElement(String name) {
- if (name == null) {
- this.getJavaResourceType().removeAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME);
- this.setRootElement_(null);
- return null;
- }
- XmlRootElementAnnotation resourceRootElement = (XmlRootElementAnnotation) getJavaResourceType().addAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME);
- resourceRootElement.setName(name);
- XmlRootElement contextRootElement = this.buildRootElement(resourceRootElement);
- this.setRootElement_(contextRootElement);
- return contextRootElement;
- }
-
- protected void setRootElement_(XmlRootElement rootElement) {
- XmlRootElement old = this.rootElement;
- this.rootElement = rootElement;
- this.firePropertyChanged(ROOT_ELEMENT, old, rootElement);
- }
-
- protected XmlRootElement buildRootElement() {
- XmlRootElementAnnotation resourceRootElement = this.getRootElementAnnotation();
- return resourceRootElement == null ? null : this.buildRootElement(resourceRootElement);
- }
-
- protected XmlRootElement buildRootElement(XmlRootElementAnnotation resourceRootElement) {
- return getFactory().buildJavaXmlRootElement(this, resourceRootElement);
- }
-
- protected void syncRootElement() {
- XmlRootElementAnnotation resourceRootElement = this.getRootElementAnnotation();
- if (resourceRootElement != null) {
- if (this.rootElement != null) {
- this.rootElement.synchronizeWithResourceModel();
- }
- else {
- this.setRootElement_(this.buildRootElement(resourceRootElement));
- }
- }
- else if (this.rootElement != null) {
- this.setRootElement_(null);
- }
- }
-
- protected XmlRootElementAnnotation getRootElementAnnotation() {
- return (XmlRootElementAnnotation) this.getJavaResourceType().getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME);
- }
-
-
- // **************** 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);
- }
-
- if (nameTouches(pos, astRoot)) {
- return getNameProposals(filter);
- }
-
- if (this.rootElement != null) {
- result = this.rootElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return getXmlTypeAnnotation().namespaceTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- protected boolean nameTouches(int pos, CompilationUnit astRoot) {
- return getXmlTypeAnnotation().nameTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getTypeNameProposals(getNamespace(), filter);
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getXmlTypeAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : super.getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateXmlType(messages, reporter, astRoot);
-
- if (this.rootElement != null) {
- this.rootElement.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // 1. if name is absent (""), namespace cannot be different from package namespace
- // 2. if name is not absent (""), type must be from schema associated with this package
-
- String name = getXmlTypeName();
- String namespace = getNamespace();
- if ("".equals(name)) {
- if (! StringTools.stringsAreEqual(namespace, getJaxbPackage().getNamespace())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE_UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE,
- this,
- getXmlTypeAnnotation().getNamespaceTextRange(astRoot)));
- }
- }
- else {
- XsdSchema schema = getJaxbPackage().getXsdSchema();
-
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE_UNRESOLVED_SCHEMA_TYPE,
- new String[] {name, namespace},
- this,
- getXmlTypeAnnotation().getTextRange(astRoot)));
- }
- }
- }
- }
-
-
- // **************** misc **************************************************
-
- public XsdTypeDefinition getXsdTypeDefinition() {
- XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
- return (xsdSchema == null) ? null : xsdSchema.getTypeDefinition(getNamespace(), getXmlTypeName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.getFullyQualifiedName());
- }
-
-
-
- /**
- * 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 AbstractJavaPersistentType.this.getResourcePropOrder();
- }
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-} \ No newline at end of file
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 3ede682352..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.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.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.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-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 AbstractJavaType(JaxbContextRoot parent, JavaResourceAbstractType resourceType) {
- super(parent);
- this.resourceType = resourceType;
-
- }
-
-
- // **************** AbstractJaxbNode impl *********************************
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // *********** JaxbType impl ***********
-
- public JavaResourceAbstractType getJavaResourceType() {
- return this.resourceType;
- }
-
- public String getFullyQualifiedName() {
- return this.resourceType.getQualifiedName();
- }
-
- public String getTypeQualifiedName() {
- String packageName = getPackageName();
- return (packageName.length() == 0) ? getFullyQualifiedName() : getFullyQualifiedName().substring(packageName.length() + 1);
- }
-
- public String getSimpleName() {
- return this.resourceType.getName();
- }
-
- public String getPackageName() {
- return this.resourceType.getPackageName();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getContextRoot().getPackage(getPackageName());
- }
-
- public Iterable<String> getDirectlyReferencedTypeNames() {
- return EmptyIterable.instance();
- }
-
-
- // **************** misc **************************************************
-
- protected CompilationUnit buildASTRoot() {
- return this.resourceType.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
-
- // **************** 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());
- }
- }
-}
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 9bc4790c04..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,130 +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.JaxbContextNode;
-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 resourceXmlJavaTypeAdapter;
-
- protected String value;
-
- protected String specifiedType;
-
- protected String defaultType;
-
- protected AbstractJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent);
- this.resourceXmlJavaTypeAdapter = resource;
- this.value = this.getResourceValue();
- this.specifiedType = this.getResourceTypeString();
- this.defaultType = this.buildDefaultType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setValue_(this.getResourceValue());
- this.setSpecifiedType_(this.getResourceTypeString());
- this.setDefaultType(this.buildDefaultType());
- }
-
-
- // ********** xml java type adapter annotation **********
-
- public XmlJavaTypeAdapterAnnotation getResourceXmlJavaTypeAdapter() {
- return this.resourceXmlJavaTypeAdapter;
- }
-
- // ********** value **********
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- this.resourceXmlJavaTypeAdapter.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.resourceXmlJavaTypeAdapter.getValue();
- }
-
-
- // ********** 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 || getSpecifiedType().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.resourceXmlJavaTypeAdapter.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.resourceXmlJavaTypeAdapter.getType();
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceXmlJavaTypeAdapter().getTextRange(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 df7840cd84..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().getParent();
- }
-
- // ********** type **********
-
- @Override
- protected String buildDefaultType() {
- return this.getPersistentAttribute().getJavaResourceAttributeTypeName();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getType() == null || getType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED,
- this,
- getResourceXmlJavaTypeAdapter().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 5ee0fbf7fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
+++ /dev/null
@@ -1,652 +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.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.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.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-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 JaxbAttributesContainer.Owner owner;
-
- protected final Vector<JaxbPersistentAttribute> attributes = new Vector<JaxbPersistentAttribute>();
-
- public GenericJavaAttributesContainer(JaxbPersistentClass parent, JaxbAttributesContainer.Owner owner, JavaResourceType resourceType) {
- super(parent);
- this.javaResourceType = resourceType;
- this.owner = owner;
- this.initializeAttributes();
- }
-
- @Override
- public JaxbPersistentClass getParent() {
- return (JaxbPersistentClass) super.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 JaxbPersistentField buildField(JavaResourceField resourceField) {
- return getFactory().buildJavaPersistentField(getParent(), resourceField);
- }
-
- protected JaxbPersistentProperty buildProperty(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return getFactory().buildJavaPersistentProperty(getParent(), resourceGetter, resourceSetter);
- }
-
- protected void initializeAttributes() {
- 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 (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 capitalizedAttributeName = StringTools.capitalize(getMethod.getName());
- String parameterTypeErasureName = getMethod.getTypeName();
- for (JavaResourceMethod sibling : resourceMethods) {
- ListIterable<String> siblingParmTypeNames = sibling.getParameterTypeNames();
- if ((sibling.getParametersSize() == 1)
- && sibling.getMethodName().equals("set" + capitalizedAttributeName) //$NON-NLS-1$
- && siblingParmTypeNames.iterator().next().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 getParent().getValidationTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMapping.java
deleted file mode 100644
index 6bfef1f08c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMapping.java
+++ /dev/null
@@ -1,604 +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.context.JaxbContainmentMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptable;
-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.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlList;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JaxbContainmentAnnotation;
-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.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-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 abstract class GenericJavaContainmentMapping<A extends JaxbContainmentAnnotation>
- extends AbstractJavaAttributeMapping<A>
- implements JaxbContainmentMapping
-{
-
- protected String specifiedName;
-
- protected Boolean specifiedRequired;
-
- protected String specifiedNamespace;
-
- protected final XmlAdaptable xmlAdaptable;
-
- protected XmlSchemaType xmlSchemaType;
-
- protected XmlList xmlList;
-
- protected XmlID xmlID;
-
- protected XmlIDREF xmlIDREF;
-
- protected XmlAttachmentRef xmlAttachmentRef;
-
- public GenericJavaContainmentMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.specifiedName = buildSpecifiedName();
- this.specifiedNamespace = buildSpecifiedNamespace();
- this.specifiedRequired = buildSpecifiedRequired();
- this.xmlAdaptable = buildXmlAdaptable();
- this.initializeXmlSchemaType();
- this.initializeXmlList();
- this.initializeXmlID();
- this.initializeXmlIDREF();
- this.initializeXmlAttachmentRef();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedName_(buildSpecifiedName());
- setSpecifiedNamespace_(buildSpecifiedNamespace());
- setSpecifiedRequired_(buildSpecifiedRequired());
- this.xmlAdaptable.synchronizeWithResourceModel();
- this.syncXmlSchemaType();
- this.syncXmlList();
- this.syncXmlID();
- this.syncXmlIDREF();
- this.syncXmlAttachmentRef();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlAdaptable.update();
- this.updateXmlSchemaType();
- this.updateXmlList();
- this.updateXmlID();
- this.updateXmlIDREF();
- this.updateXmlAttachmentRef();
- }
-
-
- //************ XmlAttribute.name ***************
- public String getName() {
- return this.getSpecifiedName() == null ? this.getDefaultName() : getSpecifiedName();
- }
-
- public String getDefaultName() {
- return getJavaResourceAttribute().getName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String name) {
- this.getAnnotationForUpdate().setName(name);
- this.setSpecifiedName_(name);
- }
-
- protected void setSpecifiedName_(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
-
- protected String buildSpecifiedName() {
- return getMappingAnnotation() == null ? null : getMappingAnnotation().getName();
- }
-
-
- //************ 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) {
- this.getAnnotationForUpdate().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 getMappingAnnotation() == null ? null : getMappingAnnotation().getRequired();
- }
-
-
- //************ XmlAttribute.namespace ***************
-
- public String getNamespace() {
- return getSpecifiedNamespace() == null ? getDefaultNamespace() : getSpecifiedNamespace();
- }
-
- public String getDefaultNamespace() {
- return getPersistentAttribute().getParent().getNamespace();
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String newSpecifiedNamespace) {
- this.getAnnotationForUpdate().setNamespace(newSpecifiedNamespace);
- this.setSpecifiedNamespace_(newSpecifiedNamespace);
- }
-
- protected void setSpecifiedNamespace_(String newSpecifiedNamespace) {
- String oldNamespace = this.specifiedNamespace;
- this.specifiedNamespace = newSpecifiedNamespace;
- firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, oldNamespace, newSpecifiedNamespace);
- }
-
- protected String buildSpecifiedNamespace() {
- return getMappingAnnotation() == null ? null : getMappingAnnotation().getNamespace();
- }
-
-
- //****************** XmlJavaTypeAdapter *********************
-
- public XmlAdaptable buildXmlAdaptable() {
- return new GenericJavaXmlAdaptable(this, new XmlAdaptable.Owner() {
- public JavaResourceAnnotatedElement getResource() {
- return getJavaResourceAttribute();
- }
- public XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation adapterAnnotation) {
- return GenericJavaContainmentMapping.this.buildXmlJavaTypeAdapter(adapterAnnotation);
- }
- public void fireXmlAdapterChanged(XmlJavaTypeAdapter oldAdapter, XmlJavaTypeAdapter newAdapter) {
- GenericJavaContainmentMapping.this.firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldAdapter, newAdapter);
- }
- });
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlAdaptable.getXmlJavaTypeAdapter();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- return this.xmlAdaptable.addXmlJavaTypeAdapter();
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- public void removeXmlJavaTypeAdapter() {
- this.xmlAdaptable.removeXmlJavaTypeAdapter();
- }
-
- //****************** XmlSchemaType *********************
-
- public XmlSchemaType getXmlSchemaType() {
- return this.xmlSchemaType;
- }
-
- protected void setXmlSchemaType_(XmlSchemaType xmlSchemaType) {
- XmlSchemaType oldXmlSchemaType = this.xmlSchemaType;
- this.xmlSchemaType = xmlSchemaType;
- this.firePropertyChanged(XML_SCHEMA_TYPE, 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, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
-
- XmlSchemaType xmlJavaTypeAdapter = this.buildXmlSchemaType(annotation);
- this.setXmlSchemaType_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlSchemaType() {
- if (this.xmlSchemaType == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(XmlSchemaTypeAnnotation.ANNOTATION_NAME);
- this.setXmlSchemaType_(null);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation annotation) {
- return new GenericJavaContainmentMappingXmlSchemaType(this, annotation);
- }
-
- protected XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- return (XmlSchemaTypeAnnotation) this.getJavaResourceAttribute().getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
- }
-
- 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 XmlList getXmlList() {
- return this.xmlList;
- }
-
- public XmlList addXmlList() {
- if (this.xmlList != null) {
- throw new IllegalStateException();
- }
- XmlListAnnotation annotation = (XmlListAnnotation) this.getJavaResourceAttribute().addAnnotation(XmlListAnnotation.ANNOTATION_NAME);
-
- XmlList xmlList = this.buildXmlList(annotation);
- this.setXmlList_(xmlList);
- return xmlList;
- }
-
- protected XmlList buildXmlList(XmlListAnnotation xmlListAnnotation) {
- return new GenericJavaXmlList(this, xmlListAnnotation);
- }
-
- public void removeXmlList() {
- if (this.xmlList == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(XmlListAnnotation.ANNOTATION_NAME);
- this.setXmlList_(null);
- }
-
- protected void initializeXmlList() {
- XmlListAnnotation annotation = this.getXmlListAnnotation();
- if (annotation != null) {
- this.xmlList = this.buildXmlList(annotation);
- }
- }
-
- protected XmlListAnnotation getXmlListAnnotation() {
- return (XmlListAnnotation) this.getJavaResourceAttribute().getAnnotation(XmlListAnnotation.ANNOTATION_NAME);
- }
-
- protected void syncXmlList() {
- XmlListAnnotation annotation = this.getXmlListAnnotation();
- if (annotation != null) {
- if (this.getXmlList() != null) {
- this.getXmlList().synchronizeWithResourceModel();
- }
- else {
- this.setXmlList_(this.buildXmlList(annotation));
- }
- }
- else {
- this.setXmlList_(null);
- }
- }
-
- protected void updateXmlList() {
- if (this.getXmlList() != null) {
- this.getXmlList().update();
- }
- }
-
- protected void setXmlList_(XmlList xmlList) {
- XmlList oldXmlList = this.xmlList;
- this.xmlList = xmlList;
- firePropertyChanged(XML_LIST_PROPERTY, oldXmlList, xmlList);
- }
-
-
- //************ XmlID ***************
-
- public XmlID getXmlID() {
- return this.xmlID;
- }
-
- public XmlID addXmlID() {
- if (this.xmlID != null) {
- throw new IllegalStateException();
- }
- XmlIDAnnotation annotation = (XmlIDAnnotation) this.getJavaResourceAttribute().addAnnotation(XmlIDAnnotation.ANNOTATION_NAME);
-
- 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(XmlIDAnnotation.ANNOTATION_NAME);
- 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(XmlIDAnnotation.ANNOTATION_NAME);
- }
-
- 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;
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
- XmlIDREFAnnotation annotation = (XmlIDREFAnnotation) this.getJavaResourceAttribute().addAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME);
-
- XmlIDREF xmlIDREF = this.buildXmlIDREF(annotation);
- this.setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- protected XmlIDREF buildXmlIDREF(XmlIDREFAnnotation xmlIDREFAnnotation) {
- return new GenericJavaXmlIDREF(this, xmlIDREFAnnotation);
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME);
- this.setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- XmlIDREFAnnotation annotation = this.getXmlIDREFAnnotation();
- if (annotation != null) {
- this.xmlIDREF = this.buildXmlIDREF(annotation);
- }
- }
-
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) this.getJavaResourceAttribute().getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME);
- }
-
- protected void syncXmlIDREF() {
- XmlIDREFAnnotation annotation = this.getXmlIDREFAnnotation();
- if (annotation != null) {
- if (this.getXmlIDREF() != null) {
- this.getXmlIDREF().synchronizeWithResourceModel();
- }
- else {
- this.setXmlIDREF_(this.buildXmlIDREF(annotation));
- }
- }
- else {
- this.setXmlIDREF_(null);
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.getXmlIDREF() != null) {
- this.getXmlIDREF().update();
- }
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
-
- //************ XmlAttachmentRef ***************
-
- public XmlAttachmentRef getXmlAttachmentRef() {
- return this.xmlAttachmentRef;
- }
-
- public XmlAttachmentRef addXmlAttachmentRef() {
- if (this.xmlAttachmentRef != null) {
- throw new IllegalStateException();
- }
- XmlAttachmentRefAnnotation annotation = (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().addAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME);
-
- 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(XmlAttachmentRefAnnotation.ANNOTATION_NAME);
- 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(XmlAttachmentRefAnnotation.ANNOTATION_NAME);
- }
-
- 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);
- }
-
-
- // **************** 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);
- this.xmlAdaptable.validate(messages, reporter, astRoot);
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.validate(messages, reporter, astRoot);
- }
- if (this.xmlList != null) {
- this.xmlList.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);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMappingXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMappingXmlSchemaType.java
deleted file mode 100644
index 52a57fdafd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaContainmentMappingXmlSchemaType.java
+++ /dev/null
@@ -1,47 +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.JaxbContainmentMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-public class GenericJavaContainmentMappingXmlSchemaType
- extends GenericJavaXmlSchemaType
-{
-
- public GenericJavaContainmentMappingXmlSchemaType(JaxbContainmentMapping parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbContainmentMapping getParent() {
- return (JaxbContainmentMapping) super.getParent();
- }
-
- protected JaxbContainmentMapping getJaxbContainmentMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getJaxbContainmentMapping().getParent();
- }
-
- protected JaxbPersistentClass getPersistentClass() {
- return getPersistentAttribute().getParent();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return this.getPersistentClass().getJaxbPackage();
- }
-}
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 7ecae1e70f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
+++ /dev/null
@@ -1,188 +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.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-public class GenericJavaElementFactoryMethod
- extends AbstractJaxbContextNode
- implements JaxbElementFactoryMethod {
-
- protected final JavaResourceMethod resourceMethod;
-
- protected String elementName;
- protected String defaultValue;
- protected String namespace;
- protected String scope;
- protected String substitutionHeadName;
- protected String substitutionHeadNamespace;
-
- public GenericJavaElementFactoryMethod(JaxbRegistry parent, JavaResourceMethod resourceMethod) {
- super(parent);
- this.resourceMethod = resourceMethod;
- this.elementName = this.getResourceElementName();
- this.defaultValue = this.getResourceDefaultValue();
- this.namespace = this.getResourceNamespace();
- this.scope = this.getResourceScope();
- this.substitutionHeadName = this.getResourceSubstitutionHeadName();
- this.substitutionHeadNamespace = this.getResourceSubstitutionHeadNamespace();
- }
-
- public JavaResourceMethod getResourceMethod() {
- return this.resourceMethod;
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setElementName_(this.getResourceElementName());
- this.setDefaultValue_(this.getResourceDefaultValue());
- this.setNamespace_(this.getResourceNamespace());
- this.setScope_(this.getResourceScope());
- this.setSubstitutionHeadName_(this.getResourceSubstitutionHeadName());
- this.setSubstitutionHeadNamespace_(this.getResourceSubstitutionHeadNamespace());
- }
-
-
- // ********** xml enum value annotation **********
-
- protected XmlElementDeclAnnotation getXmlElementDeclAnnotation() {
- return (XmlElementDeclAnnotation) this.getResourceMethod().getNonNullAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME);
- }
-
-
- // ************** JaxbElementFactoryMethod impl ***********
-
- public String getName() {
- return this.resourceMethod.getName();
- }
-
- // ********** element name **********
-
- public String getElementName() {
- return this.elementName;
- }
-
- public void setElementName(String elementName) {
- this.getXmlElementDeclAnnotation().setName(elementName);
- this.setElementName_(elementName);
- }
-
- protected void setElementName_(String elementName) {
- String old = this.elementName;
- this.elementName = elementName;
- this.firePropertyChanged(ELEMENT_NAME_PROPERTY, old, elementName);
- }
-
- protected String getResourceElementName() {
- return this.getXmlElementDeclAnnotation().getName();
- }
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.getXmlElementDeclAnnotation().setDefaultValue(defaultValue);
- this.setDefaultValue_(defaultValue);
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- protected String getResourceDefaultValue() {
- return this.getXmlElementDeclAnnotation().getDefaultValue();
- }
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- this.getXmlElementDeclAnnotation().setNamespace(namespace);
- this.setNamespace_(namespace);
- }
-
- protected void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- protected String getResourceNamespace() {
- return this.getXmlElementDeclAnnotation().getNamespace();
- }
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- this.getXmlElementDeclAnnotation().setScope(scope);
- this.setScope_(scope);
- }
-
- protected void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- this.firePropertyChanged(SCOPE_PROPERTY, old, scope);
- }
-
- protected String getResourceScope() {
- return this.getXmlElementDeclAnnotation().getScope();
- }
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- this.getXmlElementDeclAnnotation().setSubstitutionHeadName(substitutionHeadName);
- this.setSubstitutionHeadName_(substitutionHeadName);
- }
-
- protected void setSubstitutionHeadName_(String substitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = substitutionHeadName;
- this.firePropertyChanged(SUBSTIUTION_HEAD_NAME_PROPERTY, old, substitutionHeadName);
- }
-
- protected String getResourceSubstitutionHeadName() {
- return this.getXmlElementDeclAnnotation().getSubstitutionHeadName();
- }
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- this.getXmlElementDeclAnnotation().setSubstitutionHeadNamespace(substitutionHeadNamespace);
- this.setSubstitutionHeadNamespace_(substitutionHeadNamespace);
- }
-
- protected void setSubstitutionHeadNamespace_(String substitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- this.firePropertyChanged(SUBSTIUTION_HEAD_NAMESPACE_PROPERTY, old, substitutionHeadNamespace);
- }
-
- protected String getResourceSubstitutionHeadNamespace() {
- return this.getXmlElementDeclAnnotation().getSubstitutionHeadNamespace();
- }
-}
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 8c10a7a29b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
+++ /dev/null
@@ -1,87 +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.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-public class GenericJavaEnumConstant
- extends AbstractJaxbContextNode
- implements JaxbEnumConstant {
-
- final protected JavaResourceEnumConstant resourceEnumConstant;
-
- protected String specifiedValue;
-
- public GenericJavaEnumConstant(JaxbPersistentEnum parent, JavaResourceEnumConstant resourceEnumConstant) {
- super(parent);
- this.resourceEnumConstant = resourceEnumConstant;
- this.specifiedValue = this.getResourceEnumValue();
- }
-
- 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(XmlEnumValueAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** 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();
- }
-}
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 01e72145db..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
+++ /dev/null
@@ -1,33 +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.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-
-
-public class GenericJavaNullAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation> {
-
- public GenericJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- @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 a5bb6b4785..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
+++ /dev/null
@@ -1,373 +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.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.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.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-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 XmlSchemaTypeContainer xmlSchemaTypeContainer;
-
- protected final XmlJavaTypeAdapterContainer 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 = new XmlSchemaTypeContainer();
- this.xmlJavaTypeAdapterContainer = new XmlJavaTypeAdapterContainer();
- }
-
- @Override
- public JaxbPackage getParent() {
- return (JaxbPackage) super.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();
- }
-
-
- // ********** 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(XmlAccessorTypeAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** 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(XmlAccessorOrderAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** 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, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
- 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, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
- this.xmlSchemaTypeContainer.removeContextElement(index);
- }
-
- public void moveXmlSchemaType(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
- this.xmlSchemaTypeContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- return new GenericJavaPackageXmlSchemaType(this, xmlSchemaTypeAnnotation);
- }
-
- protected void syncXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.synchronizeWithResourceModel();
- }
-
- @SuppressWarnings("unchecked")
- protected ListIterable<XmlSchemaTypeAnnotation> getXmlSchemaTypeAnnotations() {
- return (ListIterable<XmlSchemaTypeAnnotation>) this.resourcePackage.getAnnotations(XmlSchemaTypeAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** 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, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
- 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, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
- this.xmlJavaTypeAdapterContainer.removeContextElement(index);
- }
-
- public void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
- this.xmlJavaTypeAdapterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaPackageXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void syncXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.synchronizeWithResourceModel();
- }
-
- @SuppressWarnings("unchecked")
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getXmlJavaTypeAdapterAnnotations() {
- return (ListIterable<XmlJavaTypeAdapterAnnotation>) this.resourcePackage.getAnnotations(XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
- }
-
-
- // **************** misc **************************************************
-
- protected CompilationUnit buildASTRoot() {
- return this.resourcePackage.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- // **************** 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) {
- 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);
-
- 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.getResourceXmlSchemaType();
- }
- }
-
- /**
- * 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.getResourceXmlJavaTypeAdapter();
- }
- }
-}
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 14f9daf4ab..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 || getSpecifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED,
- this,
- getResourceXmlJavaTypeAdapter().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 2bfc690fa0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.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.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-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().getParent();
- }
-}
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 61ee0c7334..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,392 +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.Collection;
-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.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class GenericJavaPersistentAttribute
- extends AbstractJavaContextNode
- implements JaxbPersistentAttribute {
-
- protected JaxbAttributeMapping mapping; // never null
- protected String defaultMappingKey;
-
-
- protected GenericJavaPersistentAttribute(JaxbPersistentClass parent) {
- super(parent);
- }
-
- @Override
- public JaxbPersistentClass getParent() {
- return (JaxbPersistentClass) super.getParent();
- }
-
- public boolean isInherited() {
- return getParent().isInherited(this);
- }
-
- public String getInheritedJavaResourceAttributeOwningTypeName() {
- return getParent().getJavaResourceAttributeOwningTypeName(this);
- }
-
- /**
- * subclasses must call this method in their constructor
- */
- protected void initializeMapping() {
- // keep non-null at all times
- this.mapping = this.buildMapping();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncMapping();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateMapping();
- }
-
- // ********** name **********
-
- public String getName() {
- return this.getJavaResourceAttribute().getName();
- }
-
- // ********** 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.updateDefault(); // since nothing here changes, we need to update the mapping's flag
- 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
- 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);
- this.getMapping().validate(messages, reporter, astRoot);
- }
-
-
- //**************** static methods *****************
-
- protected static String getJavaResourceAttributeType(JavaResourceAttribute attribute) {
- if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- if (attribute.getTypeTypeArgumentNamesSize() == 1) {
- return attribute.getTypeTypeArgumentName(0);
- }
- return null;
- }
- return attribute.getTypeName();
- }
-
- private static final String COLLECTION_CLASS_NAME = Collection.class.getName();
-
- protected static boolean typeIsArray(JavaResourceAttribute attribute) {
- return attribute.typeIsArray();
- }
-
- protected static boolean typeIsSubTypeOf(JavaResourceAttribute attribute, String typeName) {
- return attribute.typeIsSubTypeOf(typeName);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java
deleted file mode 100644
index 67f4f75c73..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java
+++ /dev/null
@@ -1,780 +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.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-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.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.FilteringIterable;
-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.JaxbContainmentMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptable;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-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.XmlSeeAlsoAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * To support inherited attributes in the Generic case I have made some assumptions
- * based on the JAXB RIs interpretation of the spec. Any superclass that is
- * marked as @XmlTransient will have a corresponding JaxbAttributesContainer for its JaxbClass.
- * If that XmlTransient class has no access type specified, the access type will be determined
- * by this JaxbPersistentClass's access type. If the XmlTransient class specified an access
- * type it will only be used in the case where this class does not specify an access type.
- * It will be this class's default access type. The spec states that you are not allowed
- * to use other annotations along with XmlTransient, but it appears the reference implementation
- * has made an exception for @XmlAccessorType and @XmlAccessorOrder. This is subject to change
- * pending a discussion with Blaise and the developers of the RI
- *
- */
-public class GenericJavaPersistentClass
- extends AbstractJavaPersistentType
- implements JaxbPersistentClass {
-
- protected JaxbClass superClass;
-
- protected XmlAccessType defaultAccessType;
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder defaultAccessOrder;
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected final XmlAdaptable xmlAdaptable;
-
- protected XmlSeeAlso xmlSeeAlso;
-
- protected final JaxbAttributesContainer attributesContainer;
-
- protected final Map<JaxbClass, JaxbAttributesContainer> inheritedAttributesContainers = new HashMap<JaxbClass, JaxbAttributesContainer>();
-
- public GenericJavaPersistentClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- super(parent, resourceType);
- this.superClass = this.buildSuperClass();
- this.specifiedAccessType = this.getResourceAccessType();
- this.specifiedAccessOrder = this.getResourceAccessOrder();
- this.defaultAccessType = this.buildDefaultAccessType();
- this.defaultAccessOrder = this.buildDefaultAccessOrder();
- this.xmlAdaptable = this.buildXmlAdaptable();
- initXmlSeeAlso();
- this.attributesContainer = new GenericJavaAttributesContainer(this, buildAttributesContainerOwner(), resourceType);
- this.initializeInheritedAttributes();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedAccessType_(this.getResourceAccessType());
- this.setSpecifiedAccessOrder_(this.getResourceAccessOrder());
- this.xmlAdaptable.synchronizeWithResourceModel();
- syncXmlSeeAlso();
- this.attributesContainer.synchronizeWithResourceModel();
- this.syncInheritedAttributes();
- }
-
- @Override
- public void update() {
- super.update();
- super.update();
- this.setSuperClass(this.buildSuperClass());
- this.setDefaultAccessType(this.buildDefaultAccessType());
- this.setDefaultAccessOrder(this.buildDefaultAccessOrder());
- this.xmlAdaptable.update();
- updateXmlSeeAlso();
- this.attributesContainer.update();
- this.updateInheritedAttributes();
- }
-
-
- // ********** JaxbType impl **********
-
- public Kind getKind() {
- return Kind.PERSISTENT_CLASS;
- }
-
- @Override
- public Iterable<String> getDirectlyReferencedTypeNames() {
- return new CompositeIterable<String>(
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()),
- new CompositeIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, Iterable<String>>(getAttributes()) {
- @Override
- protected Iterable<String> transform(JaxbPersistentAttribute o) {
- return o.getMapping().getDirectlyReferencedTypeNames();
- }
- }),
- getXmlSeeAlsoClasses());
- }
-
- protected Iterable<String> getXmlSeeAlsoClasses() {
- return (this.xmlSeeAlso == null) ?
- EmptyIterable.<String>instance()
- : getXmlSeeAlso().getDirectlyReferencedTypeNames();
- }
-
-
- // ********** super class **********
-
- public JaxbClass getSuperClass() {
- return this.superClass;
- }
-
- protected void setSuperClass(JaxbClass superClass) {
- JaxbClass old = this.superClass;
- this.superClass = superClass;
- this.firePropertyChanged(SUPER_CLASS_PROPERTY, old, superClass);
- }
-
- protected JaxbClass buildSuperClass() {
- HashSet<JavaResourceType> visited = new HashSet<JavaResourceType>();
- visited.add(this.getJavaResourceType());
- JaxbClass spc = this.getSuperClass(this.getJavaResourceType().getSuperclassQualifiedName(), visited);
- if (spc == null) {
- return null;
- }
- if (CollectionTools.contains(spc.getInheritanceHierarchy(), this)) {
- return null; // short-circuit in this case, we have circular inheritance
- }
- return spc;
- }
-
- /**
- * The JPA spec allows non-persistent types in a persistent type's
- * inheritance hierarchy. We check for a persistent type with the
- * specified name in the persistence unit. If it is not found we use
- * resource persistent type and look for *its* super type.
- *
- * The 'visited' collection is used to detect a cycle in the *resource* type
- * inheritance hierarchy and prevent the resulting stack overflow.
- * Any cycles in the *context* type inheritance hierarchy are handled in
- * #buildSuperPersistentType().
- */
- protected JaxbClass getSuperClass(String typeName, Collection<JavaResourceType> visited) {
- if (typeName == null) {
- return null;
- }
- JavaResourceType resourceType = (JavaResourceType) this.getJaxbProject().getJavaResourceType(typeName, JavaResourceAbstractType.Kind.TYPE);
- if ((resourceType == null) || visited.contains(resourceType)) {
- return null;
- }
- visited.add(resourceType);
- JaxbClass spc = this.getClass(typeName);
- return (spc != null && resourceType.isMapped()) ? spc : this.getSuperClass(resourceType.getSuperclassQualifiedName(), visited); // recurse
- }
-
- protected JaxbClass getClass(String fullyQualifiedTypeName) {
- return this.getParent().getClass(fullyQualifiedTypeName);
- }
-
-
- // ********** inheritance **********
-
- public Iterable<JaxbClass> getInheritanceHierarchy() {
- return this.getInheritanceHierarchyOf(this);
- }
-
- public Iterable<JaxbClass> getAncestors() {
- return this.getInheritanceHierarchyOf(this.superClass);
- }
-
- protected Iterable<JaxbClass> getInheritanceHierarchyOf(JaxbClass start) {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterable<JaxbClass>(start) {
- @Override
- protected JaxbClass nextLink(JaxbClass jaxbClass) {
- return jaxbClass.getSuperClass();
- }
- };
- }
-
- // ********** access type **********
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.defaultAccessType;
- }
-
- 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 this.defaultAccessType;
- }
-
- protected void setDefaultAccessType(XmlAccessType access) {
- XmlAccessType old = this.defaultAccessType;
- this.defaultAccessType = access;
- this.firePropertyChanged(DEFAULT_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(this.getAccessorTypeAnnotation().getValue());
- }
-
- protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME);
- }
-
- /**
- * If there is a @XmlAccessorType on a class, then it is used.
- * Otherwise, if a @XmlAccessorType exists on one of its super classes, then it is inherited.
- * Otherwise, the @XmlAccessorType on a package is inherited.
- */
- protected XmlAccessType buildDefaultAccessType() {
- XmlAccessType superAccessType = this.getSuperClassAccessType();
- if (superAccessType != null) {
- return superAccessType;
- }
- XmlAccessType packageAccessType = getPackageAccessType();
- if (packageAccessType != null) {
- return packageAccessType;
- }
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getSuperClassAccessType() {
- JaxbClass superClass = this.getSuperClass();
- return superClass == null ? null : superClass.getSpecifiedAccessType();
- }
-
- protected XmlAccessType getPackageAccessType() {
- JaxbPackageInfo packageInfo = this.getPackageInfo();
- return packageInfo == null ? null : packageInfo.getAccessType();
- }
-
-
- // ********** access order **********
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.defaultAccessOrder;
- }
-
- 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 this.defaultAccessOrder;
- }
-
- protected void setDefaultAccessOrder(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.defaultAccessOrder;
- this.defaultAccessOrder = accessOrder;
- this.firePropertyChanged(DEFAULT_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(this.getAccessorOrderAnnotation().getValue());
- }
-
- protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME);
- }
-
- /**
- * If there is a @XmlAccessorOrder on a class, then it is used.
- * Otherwise, if a @XmlAccessorOrder exists on one of its super classes, then it is inherited (by the virtue of Inherited)
- * Otherwise, the @XmlAccessorOrder on the package of the class is used, if it's there.
- * Otherwise XmlAccessOrder.UNDEFINED.
- */
- protected XmlAccessOrder buildDefaultAccessOrder() {
- XmlAccessOrder superAccessOrder = this.getSuperClassAccessOrder();
- if (superAccessOrder != null) {
- return superAccessOrder;
- }
- XmlAccessOrder packageAccessOrder = getPackageAccessOrder();
- if (packageAccessOrder != null) {
- return packageAccessOrder;
- }
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getSuperClassAccessOrder() {
- JaxbClass superClass = this.getSuperClass();
- return superClass == null ? null : superClass.getSpecifiedAccessOrder();
- }
-
- protected XmlAccessOrder getPackageAccessOrder() {
- JaxbPackageInfo packageInfo = this.getPackageInfo();
- return packageInfo == null ? null : packageInfo.getAccessOrder();
- }
-
-
- //****************** XmlJavaTypeAdapter *********************
-
- public XmlAdaptable buildXmlAdaptable() {
- return new GenericJavaXmlAdaptable(this, new XmlAdaptable.Owner() {
- public JavaResourceAnnotatedElement getResource() {
- return getJavaResourceType();
- }
- public XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation adapterAnnotation) {
- return GenericJavaPersistentClass.this.buildXmlJavaTypeAdapter(adapterAnnotation);
- }
- public void fireXmlAdapterChanged(XmlJavaTypeAdapter oldAdapter, XmlJavaTypeAdapter newAdapter) {
- GenericJavaPersistentClass.this.firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldAdapter, newAdapter);
- }
- });
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlAdaptable.getXmlJavaTypeAdapter();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- return this.xmlAdaptable.addXmlJavaTypeAdapter();
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaTypeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- public void removeXmlJavaTypeAdapter() {
- this.xmlAdaptable.removeXmlJavaTypeAdapter();
- }
-
-
- // **************** xml see also ******************************************
-
- protected XmlSeeAlsoAnnotation getXmlSeeAlsoAnnotation() {
- return (XmlSeeAlsoAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_SEE_ALSO);
- }
-
- protected void initXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- this.xmlSeeAlso = (annotation == null) ?
- null
- : buildXmlSeeAlso(annotation);
- }
-
- protected XmlSeeAlso buildXmlSeeAlso(XmlSeeAlsoAnnotation annotation) {
- return new GenericJavaXmlSeeAlso(this, annotation);
- }
-
- public XmlSeeAlso getXmlSeeAlso() {
- return this.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;
- }
-
- protected void setXmlSeeAlso_(XmlSeeAlso xmlSeeAlso) {
- XmlSeeAlso old = this.xmlSeeAlso;
- this.xmlSeeAlso = xmlSeeAlso;
- firePropertyChanged(XML_SEE_ALSO_PROPERTY, old, xmlSeeAlso);
- }
-
- public void removeXmlSeeAlso() {
- if (this.xmlSeeAlso == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(JAXB.XML_SEE_ALSO);
- setXmlSeeAlso_(null);
- }
-
- 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();
- }
- }
-
-
- // ********** attributes **********
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return this.attributesContainer.getAttributes();
- }
-
- public int getAttributesSize() {
- return this.attributesContainer.getAttributesSize();
- }
-
- protected JaxbAttributesContainer.Owner buildAttributesContainerOwner() {
- return new JaxbAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaPersistentClass.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaPersistentClass.this.fireItemAdded(ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaPersistentClass.this.fireItemRemoved(ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ********** inherited attributes **********
-
- public Iterable<JaxbPersistentAttribute> getInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(this.getInheritedAttributeSets());
- }
-
- protected Iterable<Iterable<JaxbPersistentAttribute>> getInheritedAttributeSets() {
- return new TransformationIterable<JaxbAttributesContainer, Iterable<JaxbPersistentAttribute>>(this.getInheritedAttributesContainers()) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbAttributesContainer attributesContainer) {
- return attributesContainer.getAttributes();
- }
- };
- }
-
- protected Iterable<JaxbAttributesContainer> getInheritedAttributesContainers() {
- return new LiveCloneIterable<JaxbAttributesContainer>(this.inheritedAttributesContainers.values()); // read-only
- }
-
- public int getInheritedAttributesSize() {
- int size = 0;
- for (JaxbAttributesContainer attributesContainer : getInheritedAttributesContainers()) {
- size += attributesContainer.getAttributesSize();
- }
- return size;
- }
-
- protected void initializeInheritedAttributes() {
- this.addInheritedAttributesContainer(this.getSuperClass());
- }
-
- protected void addInheritedAttributesContainer(JaxbClass superClass) {
- if (superClass != null) {
- if (superClass.getKind() == Kind.TRANSIENT) {
- this.inheritedAttributesContainers.put(superClass, this.buildInheritedAttributesContainer(superClass));
- this.addInheritedAttributesContainer(superClass.getSuperClass());
- }
- }
- }
-
- protected JaxbAttributesContainer buildInheritedAttributesContainer(JaxbClass jaxbClass) {
- return new GenericJavaAttributesContainer(this, buildInheritedAttributesContainerOwner(), jaxbClass.getJavaResourceType());
- }
-
- protected JaxbAttributesContainer.Owner buildInheritedAttributesContainerOwner() {
- return new JaxbAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaPersistentClass.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaPersistentClass.this.fireItemAdded(INHERITED_ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaPersistentClass.this.fireItemRemoved(INHERITED_ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
- protected void syncInheritedAttributes() {
- for (JaxbAttributesContainer attributesContainer : this.inheritedAttributesContainers.values()) {
- attributesContainer.synchronizeWithResourceModel();
- }
- }
-
- /**
- * 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 updateInheritedAttributes() {
- HashSet<JaxbClass> contextSuperclasses = CollectionTools.set(this.inheritedAttributesContainers.keySet());
- for (JaxbClass superClass : getAncestors()) {
- if (superClass.getKind() == Kind.TRANSIENT) {
- boolean match = false;
- for (Iterator<JaxbClass> stream = contextSuperclasses.iterator(); stream.hasNext(); ) {
- JaxbClass contextSuperclass = stream.next();
- if (contextSuperclass == superClass) {
- stream.remove();
- this.inheritedAttributesContainers.get(contextSuperclass).update();
- match = true;
- break;
- }
- }
- if ( ! match) {
- JaxbAttributesContainer container = this.buildInheritedAttributesContainer(superClass);
- this.inheritedAttributesContainers.put(superClass, container);
- this.fireItemsAdded(INHERITED_ATTRIBUTES_COLLECTION, CollectionTools.collection(container.getAttributes()));
- }
- }
- }
-
- for (JaxbClass superClass : contextSuperclasses) {
- JaxbAttributesContainer container = this.inheritedAttributesContainers.remove(superClass);
- this.fireItemsRemoved(INHERITED_ATTRIBUTES_COLLECTION, CollectionTools.collection(container.getAttributes()));
- }
- }
-
- public boolean isInherited(JaxbPersistentAttribute attribute) {
- if (attribute.getParent() != this) {
- throw new IllegalArgumentException("The attribute is not owned by this GenericJavaPersistentClass"); //$NON-NLS-1$
- }
- return !CollectionTools.contains(this.getAttributes(), attribute);
- }
-
- public String getJavaResourceAttributeOwningTypeName(JaxbPersistentAttribute attribute) {
- if (attribute.getParent() != this) {
- throw new IllegalArgumentException("The attribute is not owned by this GenericJavaPersistentClass"); //$NON-NLS-1$
- }
- for (JaxbClass inheritedClass : this.inheritedAttributesContainers.keySet()) {
- if (CollectionTools.contains(this.inheritedAttributesContainers.get(inheritedClass).getAttributes(), attribute)) {
- return inheritedClass.getSimpleName();
- }
- }
- throw new IllegalArgumentException("The attribute is not an inherited attribute"); //$NON-NLS-1$
- }
-
-
- // ********** 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 (JaxbPersistentAttribute attribute : this.getAttributes()) {
- result = attribute.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.xmlAdaptable.validate(messages, reporter, astRoot);
- this.validateXmlAnyAttributeMapping(messages, astRoot);
- this.validateXmlAnyElementMapping(messages, astRoot);
- this.validateXmlValueMapping(messages, astRoot);
- this.validateXmlIDs(messages, astRoot);
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlValueMapping(List<IMessage> messages, CompilationUnit astRoot) {
- String xmlValueMapping = null;
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- if (xmlValueMapping != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.MULTIPLE_XML_VALUE_MAPPINGS_DEFINED,
- new String[] {attribute.getName(), xmlValueMapping},
- attribute.getMapping(),
- attribute.getMapping().getValidationTextRange(astRoot)));
- }
- else {
- xmlValueMapping = attribute.getName();
- }
- }
- }
- if (xmlValueMapping != null) {
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getName() != xmlValueMapping) {
- if (attribute.getMappingKey() != MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- && attribute.getMappingKey() != MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED,
- new String[] {attribute.getName(), xmlValueMapping},
- attribute.getMapping(),
- attribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
- }
- }
-
- protected void validateXmlAnyAttributeMapping(List<IMessage> messages, CompilationUnit astRoot) {
- String xmlAnyAttributeMapping = null;
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- if (xmlAnyAttributeMapping != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.MULTIPLE_XML_ANY_ATTRIBUTE_MAPPINGS_DEFINED,
- new String[] {attribute.getName(), xmlAnyAttributeMapping},
- attribute.getMapping(),
- attribute.getMapping().getValidationTextRange(astRoot)));
- }
- else {
- xmlAnyAttributeMapping = attribute.getName();
- }
- }
- }
- }
-
- protected void validateXmlAnyElementMapping(List<IMessage> messages, CompilationUnit astRoot) {
- String xmlAnyElementMapping = null;
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- if (xmlAnyElementMapping != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.MULTIPLE_XML_ANY_ELEMENT_MAPPINGS_DEFINED,
- new String[] {attribute.getName(), xmlAnyElementMapping},
- attribute.getMapping(),
- attribute.getMapping().getValidationTextRange(astRoot)));
- }
- else {
- xmlAnyElementMapping = attribute.getName();
- }
- }
- }
- }
-
- protected void validateXmlIDs(List<IMessage> messages, CompilationUnit astRoot) {
- String xmlIdMapping = null;
- for (JaxbContainmentMapping containmentMapping : getContainmentMappingsWithXmlID()) {
- if (xmlIdMapping != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.MULTIPLE_XML_IDS_DEFINED,
- new String[] {containmentMapping.getParent().getName(), xmlIdMapping},
- containmentMapping,
- containmentMapping.getValidationTextRange(astRoot)));
- }
- else {
- xmlIdMapping = containmentMapping.getParent().getName();
- }
- }
- }
-
- protected Iterable<JaxbContainmentMapping> getContainmentMappingsWithXmlID(){
- return new FilteringIterable<JaxbContainmentMapping>(this.getContainmentMappings()){
- @Override
- protected boolean accept(JaxbContainmentMapping containmentMapping) {
- return containmentMapping.getXmlID() != null;
- }
- };
- }
-
- protected Iterable<JaxbContainmentMapping> getContainmentMappings() {
- return new SubIterableWrapper<JaxbAttributeMapping, JaxbContainmentMapping>(this.getContainmentMappings_());
- }
-
- protected Iterable<JaxbAttributeMapping> getContainmentMappings_(){
- return new FilteringIterable<JaxbAttributeMapping>(this.getAttributeMappings()){
- @Override
- protected boolean accept(JaxbAttributeMapping attributeMapping) {
- return (attributeMapping.getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY
- || attributeMapping.getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- }
- };
- }
-
- private Iterable<? extends JaxbAttributeMapping> getAttributeMappings() {
- return new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(this.getAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute attribute) {
- return attribute.getMapping();
- }
- };
- }
-
- public boolean containsXmlId() {
- return !CollectionTools.isEmpty(getContainmentMappingsWithXmlID());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java
deleted file mode 100644
index d43101901b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java
+++ /dev/null
@@ -1,131 +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.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-public class GenericJavaPersistentEnum
- extends AbstractJavaPersistentType
- implements JaxbPersistentEnum {
-
- protected String enumType;
-
- protected final EnumConstantContainer enumConstantContainer;
-
- public GenericJavaPersistentEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum) {
- super(parent, resourceEnum);
- this.enumType = this.getResourceEnumType();
- this.enumConstantContainer = new EnumConstantContainer();
- }
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
-
- // ********** JaxbType impl **********
-
- public Kind getKind() {
- return Kind.PERSISTENT_ENUM;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setEnumType_(this.getResourceEnumType());
- this.enumConstantContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.enumConstantContainer.update();
- }
-
- // ********** xml enum annotation **********
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) this.getJavaResourceType().getNonNullAnnotation(XmlEnumAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** JaxbPersistentEnum impl **********
-
- // ********** enum type **********
-
- public String getEnumType() {
- return this.enumType;
- }
-
- public void setEnumType(String enumType) {
- this.getXmlEnumAnnotation().setValue(enumType);
- this.setEnumType_(enumType);
- }
-
- protected void setEnumType_(String enumType) {
- String old = this.enumType;
- this.enumType = enumType;
- this.firePropertyChanged(ENUM_TYPE_PROPERTY, old, enumType);
- }
-
- protected String getResourceEnumType() {
- return this.getXmlEnumAnnotation().getValue();
- }
-
- public Iterable<JaxbEnumConstant> getEnumConstants() {
- return this.enumConstantContainer.getContextElements();
- }
-
- public int getEnumConstantsSize() {
- return this.enumConstantContainer.getContextElementsSize();
- }
-
- private Iterable<JavaResourceEnumConstant> getResourceEnumConstants() {
- return getJavaResourceType().getEnumConstants();
- }
-
- private JaxbEnumConstant buildEnumConstant(JavaResourceEnumConstant resourceEnumConstant) {
- return getFactory().buildJavaEnumConstant(this, resourceEnumConstant);
- }
-
- /**
- * 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 GenericJavaPersistentEnum.this.buildEnumConstant(resourceElement);
- }
- @Override
- protected Iterable<JavaResourceEnumConstant> getResourceElements() {
- return GenericJavaPersistentEnum.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/GenericJavaPersistentField.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentField.java
deleted file mode 100644
index da822fa6cc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentField.java
+++ /dev/null
@@ -1,59 +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 org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-
-public class GenericJavaPersistentField
- extends GenericJavaPersistentAttribute
- implements JaxbPersistentField {
-
-
- protected final JavaResourceField resourceField;
-
- public GenericJavaPersistentField(JaxbPersistentClass parent, JavaResourceField resourceField) {
- super(parent);
- this.resourceField = resourceField;
- this.initializeMapping();
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getResourceField();
- }
-
- public String getJavaResourceAttributeTypeName() {
- return getJavaResourceAttributeType(this.getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeTypeArray() {
- return typeIsArray(this.getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return typeIsSubTypeOf(this.getJavaResourceAttribute(), 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;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentProperty.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentProperty.java
deleted file mode 100644
index 7cf112ff5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentProperty.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.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-
-public class GenericJavaPersistentProperty
- extends GenericJavaPersistentAttribute
- implements JaxbPersistentProperty {
-
-
- protected final JavaResourceMethod resourceGetter;
-
- protected final JavaResourceMethod resourceSetter;
-
- public GenericJavaPersistentProperty(JaxbPersistentClass parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- super(parent);
- this.resourceGetter = resourceGetter;
- this.resourceSetter = resourceSetter;
- this.initializeMapping();
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.calculateResourceMethodToAnnotate();
- }
-
- public String getJavaResourceAttributeTypeName() {
- 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 : getJavaResourceAttributeType(getterMethod);
- }
-
- public boolean isJavaResourceAttributeTypeArray() {
- 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 : typeIsArray(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 : typeIsSubTypeOf(getterMethod, 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
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java
deleted file mode 100644
index a5dd8554f3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java
+++ /dev/null
@@ -1,144 +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 org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-
-public class GenericJavaRegistry
- extends AbstractJavaType
- implements JaxbRegistry {
-
- protected final ElementFactoryMethodContainer elementFactoryMethodContainer;
-
- private static final String ELEMENT_FACTORY_METHOD_CREATE_PREFIX = "create"; //$NON-NLS-1$
-
- public GenericJavaRegistry(JaxbContextRoot parent, JavaResourceType resourceType) {
- super(parent, resourceType);
- this.elementFactoryMethodContainer = new ElementFactoryMethodContainer();
- }
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- protected XmlRegistryAnnotation getAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getNonNullAnnotation(XmlRegistryAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** JaxbType impl **********
-
- public Kind getKind() {
- return Kind.REGISTRY;
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.elementFactoryMethodContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.elementFactoryMethodContainer.update();
- }
-
- public Iterable<JaxbElementFactoryMethod> getElementFactoryMethods() {
- return this.elementFactoryMethodContainer.getContextElements();
- }
-
- public int getElementFactoryMethodsSize() {
- return this.elementFactoryMethodContainer.getContextElementsSize();
- }
-
- 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);
- }
- };
- }
-
- //For now we will just check that the method has an @XmlElementDecl annotation.
- //In the future we could look for methods that are unannotated, but appear
- //to be element factory methods : begin with create, return type is JAXB element,
- //1 parameter, etc.
- protected static boolean methodIsElementFactoryMethod(JavaResourceMethod method) {
- return methodHasXmlElementDeclAnnotation(method);
- }
-
- protected static boolean methodHasXmlElementDeclAnnotation(JavaResourceMethod method) {
- return method.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME) != null;
- }
-
- protected static boolean methodStartsWithCreate(JavaResourceMethod method) {
- return method.getName().startsWith(ELEMENT_FACTORY_METHOD_CREATE_PREFIX);
- }
-
- protected static boolean methodReturnTypeIsJAXBElement(JavaResourceMethod method) {
- return method.typeIsSubTypeOf(JAXB_ELEMENT_TYPE_NAME);
- }
-
- protected static final String JAXB_ELEMENT_TYPE_NAME = "javax.xml.bind.JAXBElement"; //$NON-NLS-1$
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : super.getValidationTextRange(astRoot);
- }
-
-
- /**
- * element factory method container adapter
- */
- protected class ElementFactoryMethodContainer
- extends ContextCollectionContainer<JaxbElementFactoryMethod, JavaResourceMethod>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return ELEMENT_FACTORY_METHODS_COLLECTION;
- }
- @Override
- protected JaxbElementFactoryMethod buildContextElement(JavaResourceMethod resourceElement) {
- return GenericJavaRegistry.this.buildElementFactoryMethod(resourceElement);
- }
- @Override
- protected Iterable<JavaResourceMethod> getResourceElements() {
- return GenericJavaRegistry.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/GenericJavaTransientClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java
deleted file mode 100644
index 9c09046f58..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java
+++ /dev/null
@@ -1,236 +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.Collection;
-import java.util.HashSet;
-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.common.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-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.XmlTransientAnnotation;
-
-
-public class GenericJavaTransientClass
- extends AbstractJavaType
- implements JaxbTransientClass {
-
- protected JaxbClass superClass;
-
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder specifiedAccessOrder;
-
- public GenericJavaTransientClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- super(parent, resourceType);
- this.superClass = this.buildSuperClass();
- this.specifiedAccessType = this.getResourceAccessType();
- this.specifiedAccessOrder = this.getResourceAccessOrder();
- }
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) super.getParent();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedAccessType_(this.getResourceAccessType());
- this.setSpecifiedAccessOrder_(this.getResourceAccessOrder());
- }
-
- @Override
- public void update() {
- super.update();
- this.setSuperClass(this.buildSuperClass());
- }
-
-
- // ********** xml transient annotation **********
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) this.getJavaResourceType().getNonNullAnnotation(XmlTransientAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** JaxbType impl **********
-
- public Kind getKind() {
- return Kind.TRANSIENT;
- }
-
-
- // ********** super class **********
-
- public JaxbClass getSuperClass() {
- return this.superClass;
- }
-
- protected void setSuperClass(JaxbClass superClass) {
- JaxbClass old = this.superClass;
- this.superClass = superClass;
- this.firePropertyChanged(SUPER_CLASS_PROPERTY, old, superClass);
- }
-
- protected JaxbClass buildSuperClass() {
- HashSet<JavaResourceType> visited = new HashSet<JavaResourceType>();
- visited.add(this.getJavaResourceType());
- JaxbClass spc = this.getSuperClass(this.getJavaResourceType().getSuperclassQualifiedName(), visited);
- if (spc == null) {
- return null;
- }
- if (CollectionTools.contains(spc.getInheritanceHierarchy(), this)) {
- return null; // short-circuit in this case, we have circular inheritance
- }
- return spc;
- }
-
- /**
- * The JPA spec allows non-persistent types in a persistent type's
- * inheritance hierarchy. We check for a persistent type with the
- * specified name in the persistence unit. If it is not found we use
- * resource persistent type and look for *its* super type.
- *
- * The 'visited' collection is used to detect a cycle in the *resource* type
- * inheritance hierarchy and prevent the resulting stack overflow.
- * Any cycles in the *context* type inheritance hierarchy are handled in
- * #buildSuperPersistentType().
- */
- protected JaxbClass getSuperClass(String typeName, Collection<JavaResourceType> visited) {
- if (typeName == null) {
- return null;
- }
- JavaResourceType resourceType = (JavaResourceType) getJaxbProject().getJavaResourceType(typeName, JavaResourceAbstractType.Kind.TYPE);
- if ((resourceType == null) || visited.contains(resourceType)) {
- return null;
- }
- visited.add(resourceType);
- JaxbClass spc = this.getClass(typeName);
- return (spc != null && resourceType.isMapped()) ? spc : this.getSuperClass(resourceType.getSuperclassQualifiedName(), visited); // recurse
- }
-
- protected JaxbClass getClass(String fullyQualifiedTypeName) {
- return this.getParent().getClass(fullyQualifiedTypeName);
- }
-
-
- // ********** inheritance **********
-
- public Iterable<JaxbClass> getInheritanceHierarchy() {
- return this.getInheritanceHierarchyOf(this);
- }
-
- public Iterable<JaxbClass> getAncestors() {
- return this.getInheritanceHierarchyOf(this.superClass);
- }
-
- protected Iterable<JaxbClass> getInheritanceHierarchyOf(JaxbClass start) {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterable<JaxbClass>(start) {
- @Override
- protected JaxbClass nextLink(JaxbClass jaxbClass) {
- return jaxbClass.getSuperClass();
- }
- };
- }
-
-
- // ********** 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 null;
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(this.getAccessorTypeAnnotation().getValue());
- }
-
- protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** 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 null;
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(this.getAccessorOrderAnnotation().getValue());
- }
-
- protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME);
- }
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlTransientAnnotation().getTextRange(astRoot);
- }
-}
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 4932837849..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.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public class GenericJavaTypeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaTypeXmlJavaTypeAdapter(JaxbPersistentClass parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbPersistentClass getParent() {
- return (JaxbPersistentClass) 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/GenericJavaXmlAdaptable.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdaptable.java
deleted file mode 100644
index a533387c4e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdaptable.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.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.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptable;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-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;
-
-
-class GenericJavaXmlAdaptable
- extends AbstractJavaContextNode
- implements XmlAdaptable {
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
- protected XmlAdaptable.Owner owner;
-
- GenericJavaXmlAdaptable(JaxbNode parent, XmlAdaptable.Owner owner) {
- super(parent);
- this.owner = owner;
- this.initializeXmlJavaTypeAdapter();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateXmlJavaTypeAdapter();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.xmlJavaTypeAdapter == null ? this.owner.getResource().getTextRange(astRoot) : this.xmlJavaTypeAdapter.getResourceXmlJavaTypeAdapter().getTextRange(astRoot);
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.owner.getResource().addAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
-
- XmlJavaTypeAdapter xmlJavaTypeAdapter = this.buildXmlJavaTypeAdapter(annotation);
- this.setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return this.owner.buildXmlJavaTypeAdapter(xmlJavaTypeAdapterAnnotation);
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- this.owner.getResource().removeAnnotation(XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
- this.setXmlJavaTypeAdapter_(null);
- }
-
- protected void initializeXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = this.getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = this.buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- return (XmlJavaTypeAdapterAnnotation) this.owner.getResource().getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = this.getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.getXmlJavaTypeAdapter() != null) {
- this.getXmlJavaTypeAdapter().synchronizeWithResourceModel();
- }
- else {
- this.setXmlJavaTypeAdapter_(this.buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- this.setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.getXmlJavaTypeAdapter() != null) {
- this.getXmlJavaTypeAdapter().update();
- }
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- this.owner.fireXmlAdapterChanged(oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getXmlJavaTypeAdapter() != null) {
- this.getXmlJavaTypeAdapter().validate(messages, reporter, 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 936a98ca90..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,108 +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.XmlAdaptable;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-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.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-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 GenericJavaXmlAnyAttributeMapping
- extends AbstractJavaAttributeMapping<XmlAnyAttributeAnnotation>
- implements XmlAnyAttributeMapping
-{
-
- protected final XmlAdaptable xmlAdaptable;
-
-
- public GenericJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlAdaptable = buildXmlAdaptable();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlAdaptable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlAdaptable.update();
- }
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return XmlAnyAttributeAnnotation.ANNOTATION_NAME;
- }
-
- //****************** XmlJavaTypeAdapter *********************
-
- public XmlAdaptable buildXmlAdaptable() {
- return new GenericJavaXmlAdaptable(this, new XmlAdaptable.Owner() {
- public JavaResourceAnnotatedElement getResource() {
- return getJavaResourceAttribute();
- }
- public XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation adapterAnnotation) {
- return GenericJavaXmlAnyAttributeMapping.this.buildXmlJavaTypeAdapter(adapterAnnotation);
- }
- public void fireXmlAdapterChanged(XmlJavaTypeAdapter oldAdapter, XmlJavaTypeAdapter newAdapter) {
- GenericJavaXmlAnyAttributeMapping.this.firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldAdapter, newAdapter);
- }
- });
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlAdaptable.getXmlJavaTypeAdapter();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- return this.xmlAdaptable.addXmlJavaTypeAdapter();
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- public void removeXmlJavaTypeAdapter() {
- this.xmlAdaptable.removeXmlJavaTypeAdapter();
- }
-
- //************* 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_MAPPING_DEFINED_ON_NON_MAP,
- 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 609ccdf0ef..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
+++ /dev/null
@@ -1,228 +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.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptable;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-public class GenericJavaXmlAnyElementMapping
- extends AbstractJavaAttributeMapping<XmlAnyElementAnnotation>
- implements XmlAnyElementMapping
-{
-
- protected Boolean specifiedLax;
-
- protected String specifiedValue;
-
- protected XmlMixed xmlMixed;
-
- protected final XmlAdaptable xmlAdaptable;
-
-
- public GenericJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.specifiedLax = buildSpecifiedLax();
- this.specifiedValue = this.getResourceValueString();
- this.xmlAdaptable = buildXmlAdaptable();
- this.initializeXmlMixed();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedLax(buildSpecifiedLax());
- this.setSpecifiedValue_(this.getResourceValueString());
- this.xmlAdaptable.synchronizeWithResourceModel();
- this.syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlAdaptable.update();
- this.updateXmlMixed();
- }
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return XmlAnyElementAnnotation.ANNOTATION_NAME;
- }
-
-
- //************ lax ***************
-
- public boolean isLax() {
- return (this.getSpecifiedLax() == null) ? this.isDefaultLax() : this.getSpecifiedLax().booleanValue();
- }
-
- public boolean isDefaultLax() {
- return DEFAULT_LAX;
- }
-
- public Boolean getSpecifiedLax() {
- return this.specifiedLax;
- }
-
- public void setSpecifiedLax(Boolean newSpecifiedLax) {
- this.getAnnotationForUpdate().setLax(newSpecifiedLax);
- this.setSpecifiedLax_(newSpecifiedLax);
- }
-
- protected void setSpecifiedLax_(Boolean newSpecifiedLax) {
- Boolean oldLax = this.specifiedLax;
- this.specifiedLax = newSpecifiedLax;
- firePropertyChanged(SPECIFIED_LAX_PROPERTY, oldLax, newSpecifiedLax);
- }
-
- protected Boolean buildSpecifiedLax() {
- return getMappingAnnotation().getLax();
- }
-
- // ********** value **********
-
- public String getValue() {
- return this.getSpecifiedValue() == null ? this.getDefaultValue() : this.getSpecifiedValue();
- }
-
- public String getDefaultValue() {
- return DEFAULT_VALUE;
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String location) {
- this.getAnnotationForUpdate().setValue(location);
- this.setSpecifiedValue_(location);
- }
-
- protected void setSpecifiedValue_(String type) {
- String old = this.specifiedValue;
- this.specifiedValue = type;
- this.firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, type);
- }
-
- protected String getResourceValueString() {
- return getMappingAnnotation().getValue();
- }
-
- //****************** XmlJavaTypeAdapter *********************
-
- public XmlAdaptable buildXmlAdaptable() {
- return new GenericJavaXmlAdaptable(this, new XmlAdaptable.Owner() {
- public JavaResourceAnnotatedElement getResource() {
- return getJavaResourceAttribute();
- }
- public XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation adapterAnnotation) {
- return GenericJavaXmlAnyElementMapping.this.buildXmlJavaTypeAdapter(adapterAnnotation);
- }
- public void fireXmlAdapterChanged(XmlJavaTypeAdapter oldAdapter, XmlJavaTypeAdapter newAdapter) {
- GenericJavaXmlAnyElementMapping.this.firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldAdapter, newAdapter);
- }
- });
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlAdaptable.getXmlJavaTypeAdapter();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- return this.xmlAdaptable.addXmlJavaTypeAdapter();
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- public void removeXmlJavaTypeAdapter() {
- this.xmlAdaptable.removeXmlJavaTypeAdapter();
- }
-
-
- //************ XmlMixed ***************
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) this.getJavaResourceAttribute().addAnnotation(XmlMixedAnnotation.ANNOTATION_NAME);
-
- XmlMixed xmlMixed = this.buildXmlMixed(annotation);
- this.setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(XmlMixedAnnotation.ANNOTATION_NAME);
- this.setXmlMixed_(null);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = this.getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = this.buildXmlMixed(annotation);
- }
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) this.getJavaResourceAttribute().getAnnotation(XmlMixedAnnotation.ANNOTATION_NAME);
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = this.getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.getXmlMixed() != null) {
- this.getXmlMixed().synchronizeWithResourceModel();
- }
- else {
- this.setXmlMixed_(this.buildXmlMixed(annotation));
- }
- }
- else {
- this.setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.getXmlMixed() != null) {
- this.getXmlMixed().update();
- }
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-}
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 f6de872df5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.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.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().getParent();
- }
-
- @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 29adacbbfa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
+++ /dev/null
@@ -1,35 +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.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-public class GenericJavaXmlAttributeMapping
- extends GenericJavaContainmentMapping<XmlAttributeAnnotation>
- implements XmlAttributeMapping
-{
-
-
- public GenericJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return XmlAttributeAnnotation.ANNOTATION_NAME;
- }
-}
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 c7d5751317..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.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.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.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementMapping
- extends GenericJavaContainmentMapping<XmlElementAnnotation>
- implements XmlElementMapping
-{
-
- protected Boolean specifiedNillable;
-
- protected String defaultValue;
-
- protected String specifiedType;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- public GenericJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.specifiedNillable = this.buildSpecifiedNillable();
- this.defaultValue = this.buildDefaultValue();
- this.specifiedType = this.buildSpecifiedType();
- this.initializeXmlElementWrapper();
- }
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return XmlElementAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedNillable_(this.buildSpecifiedNillable());
- this.setDefaultValue_(this.buildDefaultValue());
- this.setSpecifiedType_(this.buildSpecifiedType());
- this.syncXmlElementWrapper();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateXmlElementWrapper();
- }
-
- //************ XmlElement.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) {
- this.getAnnotationForUpdate().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 getMappingAnnotation() == null ? null : getMappingAnnotation().getNillable();
- }
-
-
- //************ XmlElement.defaultValue ***************
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.getAnnotationForUpdate().setDefaultValue(defaultValue);
- this.setDefaultValue_(defaultValue);
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String oldDefaultValue = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, oldDefaultValue, defaultValue);
- }
-
- protected String buildDefaultValue() {
- return getMappingAnnotation() == null ? null : getMappingAnnotation().getDefaultValue();
- }
-
- //************ XmlElement.type ***************
-
- public String getType() {
- return getSpecifiedType() == null ? getDefaultType() : getSpecifiedType();
- }
-
- public String getDefaultType() {
- //TODO calculate default type
- return null;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- this.getAnnotationForUpdate().setType(newSpecifiedType);
- this.setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- return getMappingAnnotation() == null ? null : getMappingAnnotation().getType();
- }
-
- //************ XmlElementWrapper ***************
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- XmlElementWrapperAnnotation annotation = (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().addAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME);
-
- XmlElementWrapper xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- this.setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- protected XmlElementWrapper buildXmlElementWrapper(XmlElementWrapperAnnotation xmlElementWrapperAnnotation) {
- return new GenericJavaXmlElementWrapper(this, xmlElementWrapperAnnotation);
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME);
- this.setXmlElementWrapper_(null);
- }
-
- protected void initializeXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- this.xmlElementWrapper = this.buildXmlElementWrapper(annotation);
- }
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME);
- }
-
- protected void syncXmlElementWrapper() {
- XmlElementWrapperAnnotation annotation = this.getXmlElementWrapperAnnotation();
- if (annotation != null) {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- this.setXmlElementWrapper_(this.buildXmlElementWrapper(annotation));
- }
- }
- else {
- this.setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().update();
- }
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (this.getXmlElementWrapper() != null) {
- this.getXmlElementWrapper().validate(messages, reporter, astRoot);
- }
- }
-}
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 f8b0958d2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
+++ /dev/null
@@ -1,209 +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.Collection;
-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.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-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.XmlElementWrapperAnnotation;
-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 XmlElementWrapperAnnotation resourceXmlElementWrapper;
-
- protected String specifiedName;
-
- protected Boolean specifiedRequired;
-
- protected String specifiedNamespace;
-
- protected Boolean specifiedNillable;
-
- public GenericJavaXmlElementWrapper(JaxbAttributeMapping parent, XmlElementWrapperAnnotation resource) {
- super(parent);
- this.resourceXmlElementWrapper = resource;
- this.specifiedName = buildSpecifiedName();
- this.specifiedNamespace = buildSpecifiedNamespace();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedNillable = this.buildSpecifiedNillable();
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getParent();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedName_(buildSpecifiedName());
- setSpecifiedNamespace_(buildSpecifiedNamespace());
- setSpecifiedRequired_(buildSpecifiedRequired());
- this.setSpecifiedNillable_(this.buildSpecifiedNillable());
- }
-
-
- //************ XmlElementWrapper.name ***************
-
- public String getName() {
- return this.getSpecifiedName() == null ? this.getDefaultName() : getSpecifiedName();
- }
-
- public String getDefaultName() {
- return getParent().getParent().getName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String name) {
- this.resourceXmlElementWrapper.setName(name);
- this.setSpecifiedName_(name);
- }
-
- protected void setSpecifiedName_(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
-
- protected String buildSpecifiedName() {
- return this.resourceXmlElementWrapper.getName();
- }
-
-
- //************ 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) {
- this.resourceXmlElementWrapper.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 this.resourceXmlElementWrapper.getRequired();
- }
-
-
- //************ XmlElementWrapper.namespace ***************
-
- public String getNamespace() {
- return getSpecifiedNamespace() == null ? getDefaultNamespace() : getSpecifiedNamespace();
- }
-
- public String getDefaultNamespace() {
- return null;
- //TODO what is the default namespace? Is the default namespace in GeneraicJavaContainmentMapping even right? ask Paul
- //return getPersistentAttribute().getParent().getNamespace();
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String newSpecifiedNamespace) {
- this.resourceXmlElementWrapper.setNamespace(newSpecifiedNamespace);
- this.setSpecifiedNamespace_(newSpecifiedNamespace);
- }
-
- protected void setSpecifiedNamespace_(String newSpecifiedNamespace) {
- String oldNamespace = this.specifiedNamespace;
- this.specifiedNamespace = newSpecifiedNamespace;
- firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, oldNamespace, newSpecifiedNamespace);
- }
-
- protected String buildSpecifiedNamespace() {
- return this.resourceXmlElementWrapper.getNamespace();
- }
-
- //************ 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) {
- this.resourceXmlElementWrapper.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 this.resourceXmlElementWrapper.getNillable();
- }
-
-
- //************* validation ****************
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (!getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Collection.class.getName()) && !getPersistentAttribute().isJavaResourceAttributeTypeArray()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlElementWrapper.getTextRange(astRoot);
- }
-}
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 147f4f32cc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.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 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.JaxbContainmentMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-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.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(JaxbContainmentMapping parent, XmlIDAnnotation resource) {
- super(parent);
- this.resourceXmlID = resource;
- }
-
- @Override
- public JaxbContainmentMapping getParent() {
- return (JaxbContainmentMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getParent();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (!getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(String.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID_DEFINED_ON_NON_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 91e31f80d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
+++ /dev/null
@@ -1,90 +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.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-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.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlIDREF
- extends AbstractJavaContextNode
- implements XmlIDREF
-{
-
- protected final XmlIDREFAnnotation resourceXmlIDREF;
-
- public GenericJavaXmlIDREF(JaxbAttributeMapping parent, XmlIDREFAnnotation resource) {
- super(parent);
- this.resourceXmlIDREF = resource;
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getParent();
- }
-
-
- //************* validation ****************
- /**
- * From the JAXB spec section 8.9.12 XmlIDREF:
- * <p>
- * The following mapping constraints must be enforced:<ul>
- * <li> If the type of the field or property is a collection type, then the collection
- * item type must contain a property or field annotated with @XmlID.
- * <li> If the field or property is not a collection type, then the type of the
- * property or field must contain a property or field annotated with @XmlID.
- * </ul>
- * <p>
- * Note: If the collection item type or the type of the property (for non collection type)
- * is java.lang.Object, then the instance must contain a property/field annotated with @XmlID attribute.
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getPersistentAttribute().getJavaResourceAttributeTypeName() == Object.class.getName()) {
- //The instance must contain a property/field annotated with @XmlID attribute, but we cannot validate the instance
- return;
- }
- String typeName = getPersistentAttribute().getJavaResourceAttributeTypeName();
- JaxbPersistentClass persistentClass = getContextRoot().getPersistentClass(typeName);
- if (persistentClass != null) {
- if (!persistentClass.containsXmlId()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_IDREF_TYPE_DOES_NOT_CONTAIN_XML_ID,
- new String[] {getPersistentAttribute().getName(), typeName},
- this,
- getValidationTextRange(astRoot)));
- }
- }
- else {
- //do we validate this case??
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlIDREF.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java
deleted file mode 100644
index 33fd6e75d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.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.internal.context.java;
-
-import java.util.Collection;
-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.JaxbContainmentMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlList;
-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.XmlListAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlList
- extends AbstractJavaContextNode
- implements XmlList
-{
-
- protected final XmlListAnnotation resourceXmlList;
-
- public GenericJavaXmlList(JaxbContainmentMapping parent, XmlListAnnotation resource) {
- super(parent);
- this.resourceXmlList = resource;
- }
-
- @Override
- public JaxbContainmentMapping getParent() {
- return (JaxbContainmentMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getParent();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (!getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Collection.class.getName()) && !getPersistentAttribute().isJavaResourceAttributeTypeArray()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST_DEFINED_ON_NON_ARRAY_NON_COLLECTION,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlList.getTextRange(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 066c6eaec4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
+++ /dev/null
@@ -1,47 +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().getParent();
- }
-
-
- //************* 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 f7ea03d94a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
+++ /dev/null
@@ -1,111 +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.context.java;
-
-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.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-public class GenericJavaXmlNs
- extends AbstractJaxbContextNode
- 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());
- }
-
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getParent().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();
- }
-
-
- //****************** 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/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 eb90f36a80..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
+++ /dev/null
@@ -1,238 +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.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.jpt.jaxb.core.context.JaxbPersistentType;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-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.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 resourceXmlRootElementAnnotation;
-
- protected String specifiedName;
-
- protected String specifiedNamespace;
-
-
- public GenericJavaXmlRootElement(JaxbPersistentType parent, XmlRootElementAnnotation resourceXmlRootElementAnnotation) {
- super(parent);
- this.resourceXmlRootElementAnnotation = resourceXmlRootElementAnnotation;
- this.specifiedName = this.getResourceName();
- this.specifiedNamespace = this.getResourceNamespace();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedName_(this.getResourceName());
- this.setSpecifiedNamespace_(this.getResourceNamespace());
- }
-
-
- @Override
- public JaxbPersistentType getParent() {
- return (JaxbPersistentType) super.getParent();
- }
-
-
- // ********** name **********
-
- public String getName() {
- return (this.specifiedName != null) ? this.specifiedName : getDefaultName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String name) {
- this.resourceXmlRootElementAnnotation.setName(name);
- this.setSpecifiedName_(name);
- }
-
- protected void setSpecifiedName_(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultName() {
- return Introspector.decapitalize(getParent().getSimpleName());
- }
-
- protected String getResourceName() {
- return this.resourceXmlRootElementAnnotation.getName();
- }
-
-
- // ********** namespace **********
-
- public String getNamespace() {
- return (this.specifiedNamespace != null) ? this.specifiedNamespace : getDefaultNamespace();
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String namespace) {
- this.resourceXmlRootElementAnnotation.setNamespace(namespace);
- this.setSpecifiedNamespace_(namespace);
- }
-
- protected void setSpecifiedNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
- }
-
- public String getDefaultNamespace() {
- return getParent().getJaxbPackage().getNamespace();
- }
-
- protected String getResourceNamespace() {
- return this.resourceXmlRootElementAnnotation.getNamespace();
- }
-
-
- // **************** 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);
- }
-
- if (nameTouches(pos, astRoot)) {
- return getNameProposals(filter);
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return this.resourceXmlRootElementAnnotation.namespaceTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = getParent().getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- protected boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.resourceXmlRootElementAnnotation.nameTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- String namespace = getNamespace();
- XsdSchema schema = getParent().getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdElementDeclaration, String>(schema.getElementDeclarations(namespace)) {
- @Override
- protected String transform(XsdElementDeclaration o) {
- return o.getName();
- }
- },
- filter));
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlRootElementAnnotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String name = getName();
- String namespace = getNamespace();
-
- XsdSchema schema = getParent().getJaxbPackage().getXsdSchema();
-
- if (schema != null) {
- // element must resolve
- XsdElementDeclaration schemaElement = schema.getElementDeclaration(namespace, name);
- if (schemaElement == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ROOT_ELEMENT_UNRESOLVED_SCHEMA_ELEMENT,
- new String[] {name, namespace},
- this,
- this.resourceXmlRootElementAnnotation.getTextRange(astRoot)));
- }
- else {
- // element type must agree with parent's schema type
- XsdTypeDefinition schemaType = getParent().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,
- this.resourceXmlRootElementAnnotation.getTextRange(astRoot)));
- }
- }
- }
- }
- }
-
-
- //****************** miscellaneous ********************
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append("namespace = \"" + this.specifiedNamespace + "\"");
- sb.append("; name = \"" + this.specifiedName + "\"");
- }
-}
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 61ea9e2b7f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
+++ /dev/null
@@ -1,287 +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 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.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-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.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-public class GenericJavaXmlSchema
- extends AbstractJavaContextNode
- implements XmlSchema {
-
- protected String specifiedNamespace;
-
- protected String location;
-
- protected XmlNsForm attributeFormDefault;
-
- protected XmlNsForm elementFormDefault;
-
- protected final XmlNsPrefixContainer xmlNsPrefixContainer;
-
-
- public GenericJavaXmlSchema(JaxbPackageInfo parent) {
- super(parent);
- this.specifiedNamespace = this.getResourceNamespace();
- this.location = this.getResourceLocation();
- this.attributeFormDefault = this.getResourceAttributeFormDefault();
- this.elementFormDefault = this.getResourceElementFormDefault();
- this.xmlNsPrefixContainer = new XmlNsPrefixContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedNamespace_(this.getResourceNamespace());
- this.setLocation_(this.getResourceLocation());
- this.setAttributeFormDefault_(this.getResourceAttributeFormDefault());
- this.setElementFormDefault_(this.getResourceElementFormDefault());
- this.syncXmlNsPrefixes();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateXmlNsPrefixes();
- }
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getParent().getResourcePackage();
- }
-
-
- // ********** xml schema annotation **********
-
- protected XmlSchemaAnnotation getXmlSchemaAnnotation() {
- return (XmlSchemaAnnotation) this.getResourcePackage().getNonNullAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
- }
-
- // ********** namespace **********
-
- public String getNamespace() {
- return (this.specifiedNamespace == null) ? "" : this.specifiedNamespace;
- }
-
- 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.attributeFormDefault;
- }
-
- public void setAttributeFormDefault(XmlNsForm xmlNsForm) {
- this.getXmlSchemaAnnotation().setAttributeFormDefault(XmlNsForm.toJavaResourceModel(xmlNsForm));
- this.setAttributeFormDefault_(xmlNsForm);
- }
-
- protected void setAttributeFormDefault_(XmlNsForm xmlNsForm) {
- XmlNsForm old = this.attributeFormDefault;
- this.attributeFormDefault = xmlNsForm;
- this.firePropertyChanged(ATTRIBUTE_FROM_DEFAULT_PROPERTY, old, xmlNsForm);
- }
-
- protected XmlNsForm getResourceAttributeFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getAttributeFormDefault());
- }
-
-
- // ********** element form default **********
-
- public XmlNsForm getElementFormDefault() {
- return this.elementFormDefault;
- }
-
- public void setElementFormDefault(XmlNsForm xmlNsForm) {
- this.getXmlSchemaAnnotation().setElementFormDefault(XmlNsForm.toJavaResourceModel(xmlNsForm));
- this.setElementFormDefault_(xmlNsForm);
- }
-
- protected void setElementFormDefault_(XmlNsForm xmlNsForm) {
- XmlNsForm old = this.elementFormDefault;
- this.elementFormDefault = xmlNsForm;
- this.firePropertyChanged(ELEMENT_FROM_DEFAULT_PROPERTY, old, xmlNsForm);
- }
-
- 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();
- }
-
-
- // **************** 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);
- }
-
- 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>(
- getJaxbProject().getSchemaLibrary().getSchemaLocations().keySet(), filter));
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().getTextRange(astRoot);
- }
-
-
- /**
- * 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 a9d0c4dabc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
+++ /dev/null
@@ -1,196 +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.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.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-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;
-import org.eclipse.xsd.util.XSDUtil;
-
-public abstract class GenericJavaXmlSchemaType
- extends AbstractJavaContextNode
- implements XmlSchemaType {
-
- protected final XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation;
-
- protected String name;
-
- protected String specifiedNamespace;
-
- protected String type;
-
-
- protected GenericJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent);
- this.xmlSchemaTypeAnnotation = xmlSchemaTypeAnnotation;
- this.name = this.getResourceName();
- this.specifiedNamespace = this.getResourceNamespace();
- this.type = this.getResourceTypeString();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setName_(this.getResourceName());
- this.setNamespace_(this.getResourceNamespace());
- this.setType_(this.getResourceTypeString());
- }
-
-
- // ********** xml schema type annotation **********
-
- public XmlSchemaTypeAnnotation getResourceXmlSchemaType() {
- return this.xmlSchemaTypeAnnotation;
- }
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.xmlSchemaTypeAnnotation.setName(name);
- this.setName_(name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- protected String getResourceName() {
- return this.xmlSchemaTypeAnnotation.getName();
- }
-
- // ********** namespace **********
-
- public String getNamespace() {
- return getSpecifiedNamespace() == null ? getDefaultNamespace() : getSpecifiedNamespace();
- }
-
- public String getDefaultNamespace() {
- return XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001;
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String location) {
- this.xmlSchemaTypeAnnotation.setNamespace(location);
- this.setNamespace_(location);
- }
-
- protected void setNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
- }
-
- protected String getResourceNamespace() {
- return this.xmlSchemaTypeAnnotation.getNamespace();
- }
-
-
- // ********** type **********
-
- public String getType() {
- return this.type;
- }
-
- public void setType(String location) {
- this.xmlSchemaTypeAnnotation.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.xmlSchemaTypeAnnotation.getType();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.xmlSchemaTypeAnnotation.getTextRange(astRoot);
- }
-
-
- // *********** 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);
- }
-
- if (nameTouches(pos, astRoot)) {
- return getNameProposals(filter);
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return getResourceXmlSchemaType().namespaceTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- protected boolean nameTouches(int pos, CompilationUnit astRoot) {
- return getResourceXmlSchemaType().nameTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = getJaxbPackage().getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getSimpleTypeNameProposals(getNamespace(), filter);
- }
-
- protected abstract JaxbPackage getJaxbPackage();
-
-}
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 10bd71e06b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
+++ /dev/null
@@ -1,101 +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.JaxbPersistentClass;
-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 ValueContainer valueContainer;
-
-
- public GenericJavaXmlSeeAlso(JaxbPersistentClass parent, XmlSeeAlsoAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.valueContainer = new ValueContainer();
- }
-
-
- public JaxbPersistentClass getPersistentClass() {
- return (JaxbPersistentClass) getParent();
- }
-
- @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> getDirectlyReferencedTypeNames() {
- return this.annotation.getFullyQualifiedClasses();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
-
- 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 d3ecbcc391..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.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.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.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 XmlTransientAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<String> getDirectlyReferencedTypeNames() {
- return EmptyIterable.instance();
- }
-}
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 fcd0f21f98..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.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.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptable;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-public class GenericJavaXmlValueMapping
- extends AbstractJavaAttributeMapping<XmlValueAnnotation>
- implements XmlValueMapping
-{
- protected final XmlAdaptable xmlAdaptable;
-
-
- public GenericJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlAdaptable = buildXmlAdaptable();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlAdaptable.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlAdaptable.update();
- }
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return XmlValueAnnotation.ANNOTATION_NAME;
- }
-
- //****************** XmlJavaTypeAdapter *********************
-
- public XmlAdaptable buildXmlAdaptable() {
- return new GenericJavaXmlAdaptable(this, new XmlAdaptable.Owner() {
- public JavaResourceAnnotatedElement getResource() {
- return getJavaResourceAttribute();
- }
- public XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation adapterAnnotation) {
- return GenericJavaXmlValueMapping.this.buildXmlJavaTypeAdapter(adapterAnnotation);
- }
- public void fireXmlAdapterChanged(XmlJavaTypeAdapter oldAdapter, XmlJavaTypeAdapter newAdapter) {
- GenericJavaXmlValueMapping.this.firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldAdapter, newAdapter);
- }
- });
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlAdaptable.getXmlJavaTypeAdapter();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- return this.xmlAdaptable.addXmlJavaTypeAdapter();
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- public void removeXmlJavaTypeAdapter() {
- this.xmlAdaptable.removeXmlJavaTypeAdapter();
- }
-}
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 e7b3e43b54..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.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.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.XmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-
-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 =
- {XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME};
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlAnyAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return XmlAnyAttributeAnnotation.ANNOTATION_NAME;
- }
-
- 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 ce4a60988b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.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.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.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-
-public class JavaXmlAnyElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAnyElementMappingDefinition INSTANCE =
- new JavaXmlAnyElementMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME,
- XmlMixedAnnotation.ANNOTATION_NAME};
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlAnyElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return XmlAnyElementAnnotation.ANNOTATION_NAME;
- }
-
- 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 2a7e2d8c98..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
+++ /dev/null
@@ -1,77 +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.XmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-
-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 =
- {XmlIDAnnotation.ANNOTATION_NAME,
- XmlIDREFAnnotation.ANNOTATION_NAME,
- XmlListAnnotation.ANNOTATION_NAME,
- XmlSchemaTypeAnnotation.ANNOTATION_NAME,
- XmlAttachmentRefAnnotation.ANNOTATION_NAME,
- XmlMimeTypeAnnotation.ANNOTATION_NAME,
- XmlInlineBinaryDataAnnotation.ANNOTATION_NAME,
- XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME};
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return XmlAttributeAnnotation.ANNOTATION_NAME;
- }
-
- 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 ac77dc9fee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
+++ /dev/null
@@ -1,105 +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.Collection;
-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.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-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.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-
-public class JavaXmlElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
- implements DefaultJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlElementMappingDefinition INSTANCE =
- new JavaXmlElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {XmlIDAnnotation.ANNOTATION_NAME,
- XmlIDREFAnnotation.ANNOTATION_NAME,
- XmlListAnnotation.ANNOTATION_NAME,
- XmlSchemaTypeAnnotation.ANNOTATION_NAME,
- XmlAttachmentRefAnnotation.ANNOTATION_NAME,
- XmlMimeTypeAnnotation.ANNOTATION_NAME,
- XmlInlineBinaryDataAnnotation.ANNOTATION_NAME,
- XmlElementWrapperAnnotation.ANNOTATION_NAME,
- XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME};
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return XmlElementAnnotation.ANNOTATION_NAME;
- }
-
- 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)})
- * </ul>
- */
- public boolean isDefault(JaxbPersistentAttribute persistentAttribute) {
- JavaResourceAttribute resourceAttribute = persistentAttribute.getJavaResourceAttribute();
- if (resourceAttribute.typeIsSubTypeOf(Collection.class.getName())) {
- return resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME) != null;
- }
- return true;
- }
-}
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 de1049e956..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.XmlTransientAnnotation;
-
-
-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
- */
- private JavaXmlTransientMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return XmlTransientAnnotation.ANNOTATION_NAME;
- }
-
- 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 2b01af0865..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.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.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.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-
-public class JavaXmlValueMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlValueMappingDefinition INSTANCE =
- new JavaXmlValueMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {XmlListAnnotation.ANNOTATION_NAME,
- XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME};
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaXmlValueMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return XmlValueAnnotation.ANNOTATION_NAME;
- }
-
- 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/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 c1a2b6b5bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
+++ /dev/null
@@ -1,277 +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);
- }
-}
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 40e26c3349..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,20 +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();
- }
-}
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 619274ea66..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
+++ /dev/null
@@ -1,264 +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.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-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_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;
-
- // ********** 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);
- }
-
- // ********** 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 = (usesMoxyGenerator) ? JAXB_ECLIPSELINK_GEN_CLASS : JAXB_GENERIC_GEN_CLASS;
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- // ********** behavior **********
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- //nothing to do yet...
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- try {
- this.javaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** 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());
- }
- 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.targetIs20()) {
- programArguments.append(" -target 2.0"); //$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 fd361d7054..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.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.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 targetIs20;
- 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 targetIs20() {
- return this.targetIs20;
- }
-
- public void setTargetIs20(boolean targetIs20){
- this.targetIs20 = targetIs20;
- }
-
- 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 9027ff2c83..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 schemaPathOrUri;
- 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 schemaPathOrUri,
- 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(schemaPathOrUri)) {
- 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.schemaPathOrUri = schemaPathOrUri;
- 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.schemaPathOrUri,
- 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 schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- ClassesGenerator.generate(javaProject,
- schemaPathOrUri,
- 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 7f68cbe5e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
+++ /dev/null
@@ -1,287 +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.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.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.NullProgressMonitor;
-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 (!isJaxbPropertiesFilePresent()){
- this.generateJaxbPropertiesFile(monitor);
- }
- else if (!isJaxbContextMoxy()){
- //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;
- }
- }
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- try {
- this.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** 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){
- Object[] objects = null;
- IJavaElement[] javaElements;
- try {
- for (IPackageFragmentRoot pfr : packageFragmentRoots) {
- javaElements = pfr.getChildren();
- for (IJavaElement javaElement : javaElements) {
- objects = ((IPackageFragment) javaElement).getNonJavaResources();
- for (Object object : objects) {
- IResource resource = (IResource) object;
- if (resource.getName().equals(JAXB_PROPERTIES_FILE_NAME)) {
- // jaxb.properties has been found
- return (IFile)resource;
- }
- }
- }
- }
- } catch (JavaModelException jme) {
- throw new RuntimeException(jme);
- }
- return null;
- }
-
- private boolean isJaxbPropertiesFilePresent(){
- return getJaxbPropertiesFile()!= null;
- }
-
- private boolean isJaxbContextMoxy(){
-
- InputStream in = null;
- try {
- in = 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 = 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) {
- 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$
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/AbstractJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/AbstractJaxb_2_1_PlatformDefinition.java
deleted file mode 100644
index c8a445aa9a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/AbstractJaxb_2_1_PlatformDefinition.java
+++ /dev/null
@@ -1,144 +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.jaxb21;
-
-import java.util.ArrayList;
-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.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.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.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.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.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.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-
-public abstract class AbstractJaxb_2_1_PlatformDefinition
- extends AbstractJaxbPlatformDefinition {
-
- protected AbstractJaxb_2_1_PlatformDefinition() {
- super();
- }
-
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return new AnnotationDefinition[] {
- XmlAccessorOrderAnnotationDefinition.instance(),
- XmlAccessorTypeAnnotationDefinition.instance(),
- XmlAnyAttributeAnnotationDefinition.instance(),
- XmlAnyElementAnnotationDefinition.instance(),
- XmlAttachmentRefAnnotationDefinition.instance(),
- XmlAttributeAnnotationDefinition.instance(),
- XmlElementAnnotationDefinition.instance(),
- XmlElementDeclAnnotationDefinition.instance(),
- XmlElementsAnnotationDefinition.instance(),
- XmlElementWrapperAnnotationDefinition.instance(),
- XmlEnumAnnotationDefinition.instance(),
- XmlEnumValueAnnotationDefinition.instance(),
- XmlIDAnnotationDefinition.instance(),
- XmlIDREFAnnotationDefinition.instance(),
- XmlInlineBinaryDataAnnotationDefinition.instance(),
- XmlListAnnotationDefinition.instance(),
- XmlMimeTypeAnnotationDefinition.instance(),
- XmlMixedAnnotationDefinition.instance(),
- XmlRegistryAnnotationDefinition.instance(),
- XmlRootElementAnnotationDefinition.instance(),
- XmlSchemaAnnotationDefinition.instance(),
- XmlSeeAlsoAnnotationDefinition.instance(),
- XmlTransientAnnotationDefinition.instance(),
- XmlTypeAnnotationDefinition.instance(),
- XmlValueAnnotationDefinition.instance()};
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return new NestableAnnotationDefinition[] {
- XmlElementRefAnnotationDefinition.instance(),
- XmlJavaTypeAdapterAnnotationDefinition.instance(),
- XmlSchemaTypeAnnotationDefinition.instance()
- };
- }
-
- // ********** resource models **********
-
- 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 JaxbResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JaxbResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JavaPackageInfoResourceModelProvider.instance()};
- }
-
-
- // ********** Java attribute mappings **********
-
- @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(JavaXmlTransientMappingDefinition.instance());
- definitions.add(JavaXmlValueMappingDefinition.instance());
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlElementMappingDefinition.instance());
- }
-}
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 d37260c1b5..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,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.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class GenericJaxb_2_1_PlatformDefinition
- extends AbstractJaxb_2_1_PlatformDefinition {
-
- // 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();
- }
-}
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/AbstractJaxb_2_2_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/AbstractJaxb_2_2_PlatformDefinition.java
deleted file mode 100644
index 37ed7e7a15..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/AbstractJaxb_2_2_PlatformDefinition.java
+++ /dev/null
@@ -1,20 +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.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.AbstractJaxb_2_1_PlatformDefinition;
-
-public abstract class AbstractJaxb_2_2_PlatformDefinition
- extends AbstractJaxb_2_1_PlatformDefinition {
-
- protected AbstractJaxb_2_2_PlatformDefinition() {
- super();
- }
-}
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 adc1b32c67..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,44 +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.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class GenericJaxb_2_2_PlatformDefinition
- extends AbstractJaxb_2_2_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();
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_2;
- }
-
- 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/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 762a8c98e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.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.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.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.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig;
-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 jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
-
- Set<String> classNames = new HashSet<String>();
-
- if (jreJaxbVersion == null) {
- classNames.add("javax.xml.bind.annotation.XmlSeeAlso"); //$NON-NLS-1$
- }
- if (jaxbVersion.compareTo(JaxbFacet.VERSION_2_2) >= 0
- && (jreJaxbVersion == null || jreJaxbVersion.compareTo(JaxbFacet.VERSION_2_2) < 0)) {
- classNames.add("javax.xml.bind.JAXBPermission"); //$NON-NLS-1$
- }
-
- Iterable<IPath> libraryPaths =
- new TransformationIterable<IClasspathEntry, IPath>(jaxbConfig.resolve()) {
- @Override
- protected IPath transform(IClasspathEntry o) {
- return o.getPath();
- }
- };
-
- return LibValUtil.validate(libraryPaths, classNames);
- }
-}
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 462dd9ac4e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.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.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.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 jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
-
- if (jreJaxbVersion == null || jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, JptJaxbCoreMessages.JreLibraryValidator_invalidJreJaxbVersion);
- }
-
- 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 8d3a913fd9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
+++ /dev/null
@@ -1,135 +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.IPath;
-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.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 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();
- 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) {
- if (javaVersion.startsWith(JavaCore.VERSION_1_7)) {
- return JaxbFacet.VERSION_2_2;
- }
- // all other versions except 1.6 have no corresponding version (as of yet)
- // 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 4721f2c5d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.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.internal.platform;
-
-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.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.AnnotationProvider;
-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.internal.GenericAnnotationProvider;
-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();
- }
-
- // ********** 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/resource/java/NullAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullAnnotation.java
deleted file mode 100644
index a5fb26a455..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullAnnotation.java
+++ /dev/null
@@ -1,78 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.AbstractJavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-
-/**
- * Simplify null annotation classes
- */
-public abstract class NullAnnotation
- extends AbstractJavaResourceNode
- implements Annotation
-{
-
- protected NullAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- throw new UnsupportedOperationException();
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Convenience method: Cast the annotation's parent to a
- * persistent member.
- */
- protected JavaResourceAnnotatedElement getAnnotatedElement() {
- return (JavaResourceAnnotatedElement) this.parent;
- }
-
- /**
- * Convenience method: Add the type or attribute's annotation
- * and return it.
- * Pre-condition: The annotation's parent must be a persistent member
- * (type or attribute).
- */
- protected Annotation addAnnotation() {
- return this.getAnnotatedElement().addAnnotation(this.getAnnotationName());
- }
-
-}
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 dae57d6a99..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-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(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 bb8856ee0e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-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(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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/NullXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java
deleted file mode 100644
index 72f000dedd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,134 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class NullXmlElementDeclAnnotation
- extends NullAnnotation
- implements XmlElementDeclAnnotation
-{
- protected NullXmlElementDeclAnnotation(JavaResourceMethod parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected XmlElementDeclAnnotation addAnnotation() {
- return (XmlElementDeclAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** 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;
- }
-
- // ***** 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;
- }
-
- // ***** defaultValue
- public String getDefaultValue() {
- return null;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (defaultValue != null) {
- this.addAnnotation().setDefaultValue(defaultValue);
- }
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** scope
- public String getScope() {
- return null;
- }
-
- public String getFullyQualifiedScopeClassName() {
- return null;
- }
-
- public void setScope(String scope) {
- if (scope != null) {
- this.addAnnotation().setScope(scope);
- }
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** substitutionHeadName
- public String getSubstitutionHeadName() {
- return null;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- if (substitutionHeadName != null) {
- this.addAnnotation().setSubstitutionHeadName(substitutionHeadName);
- }
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** substitutionHeadNamespace
- public String getSubstitutionHeadNamespace() {
- return null;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- if (substitutionHeadNamespace != null) {
- this.addAnnotation().setSubstitutionHeadNamespace(substitutionHeadNamespace);
- }
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(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 25ee32e4a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class NullXmlEnumAnnotation
- extends NullAnnotation
- implements XmlEnumAnnotation
-{
- protected NullXmlEnumAnnotation(JavaResourceAbstractType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 4d2adeba94..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class NullXmlEnumValueAnnotation
- extends NullAnnotation
- implements XmlEnumValueAnnotation
-{
- protected NullXmlEnumValueAnnotation(JavaResourceEnumConstant parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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;
- }
-}
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 667baacffd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,137 +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.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.JavaResourcePackage;
-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(JavaResourcePackage parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 339a8b3679..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
+++ /dev/null
@@ -1,144 +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.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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class NullXmlTypeAnnotation
- extends NullAnnotation
- implements XmlTypeAnnotation
-{
- protected NullXmlTypeAnnotation(JavaResourceAbstractType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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();
- }
-
-}
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 362d0f430b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.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.IAnnotation;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * 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 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);
- }
-
- public String getAnnotationName() {
- return XmlAccessorOrderAnnotation.ANNOTATION_NAME;
- }
-
-}
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 e36e85dd89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.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.IAnnotation;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * 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 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);
- }
-
- public String getAnnotationName() {
- return XmlAccessorTypeAnnotation.ANNOTATION_NAME;
- }
-
-}
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 008f0be7cf..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyAttributeAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyAttributeAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlAnyAttributeAnnotation.ANNOTATION_NAME;
- }
-
-}
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 1a652d1664..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.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.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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyElementAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyElementAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlAnyElementAnnotation.ANNOTATION_NAME;
- }
-
-}
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 4de95f3fff..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.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.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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttachmentRefAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttachmentRefAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlAttachmentRefAnnotation.ANNOTATION_NAME;
- }
-
-}
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 f1386ae20d..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttributeAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttributeAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlAttributeAnnotation.ANNOTATION_NAME;
- }
-
-}
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 aadf23dedf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementAnnotation.buildSourceXmlElementAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlElementAnnotation.ANNOTATION_NAME;
- }
-}
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 80e909350d..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementDeclAnnotation((JavaResourceMethod) parent, (MethodAttribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlElementDeclAnnotation((JavaResourceMethod) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementDeclAnnotation((JavaResourceMethod) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlElementDeclAnnotation.ANNOTATION_NAME;
- }
-
-}
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 906de66d39..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
+++ /dev/null
@@ -1,71 +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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class XmlElementRefAnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlElementRefAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefAnnotationDefinition() {
- super();
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlElementRefAnnotation.buildSourceXmlElementRefAnnotation((JavaResourceField) parent, (Attribute) annotatedElement, index);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefAnnotation(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public String getElementName() {
- return JAXB.XML_ELEMENT_REFS__VALUE;
- }
-
-}
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 56efd05d7c..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementWrapperAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementWrapperAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlElementWrapperAnnotation.ANNOTATION_NAME;
- }
-
-}
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 d9a5683a43..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.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.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-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.BinaryXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementsAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementsAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlElementsAnnotation.ANNOTATION_NAME;
- }
-}
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 fd8f2c8db7..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.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumAnnotation((JavaResourceAbstractType) parent, (AbstractType) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumAnnotation((JavaResourceAbstractType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumAnnotation((JavaResourceAbstractType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlEnumAnnotation.ANNOTATION_NAME;
- }
-
-}
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 309104f514..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.EnumConstant;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumValueAnnotation((JavaResourceEnumConstant) parent, (EnumConstant) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumValueAnnotation((JavaResourceEnumConstant) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumValueAnnotation((JavaResourceEnumConstant) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlEnumValueAnnotation.ANNOTATION_NAME;
- }
-
-}
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 de18ccecf0..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlIDAnnotation.ANNOTATION_NAME;
- }
-
-}
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 2d07bc9a34..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDREFAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDREFAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlIDREFAnnotation.ANNOTATION_NAME;
- }
-
-}
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 8d14d81a46..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInlineBinaryDataAnnotation((JavaResourceMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInlineBinaryDataAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlInlineBinaryDataAnnotation.ANNOTATION_NAME;
- }
-
-}
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 8d3039fd24..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.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.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-/**
- * 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 NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlJavaTypeAdapterAnnotation.buildSourceXmlJavaTypeAdapterAnnotation(parent, annotatedElement, index);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlJavaTypeAdapterAnnotation(parent, jdtAnnotation);
- }
-
- 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;
- }
-}
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 5ee5334802..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlListAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlListAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlListAnnotation.ANNOTATION_NAME;
- }
-
-}
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 084b40291a..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMimeTypeAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMimeTypeAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlMimeTypeAnnotation.ANNOTATION_NAME;
- }
-
-}
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 77263c2fd1..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMixedAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMixedAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlMixedAnnotation.ANNOTATION_NAME;
- }
-
-}
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 eac9f401b6..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.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRegistryAnnotation((JavaResourceAbstractType) parent, (AbstractType) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRegistryAnnotation((JavaResourceAbstractType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlRegistryAnnotation.ANNOTATION_NAME;
- }
-
-}
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 62f222c346..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.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRootElementAnnotation((JavaResourceAbstractType) parent, (AbstractType) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRootElementAnnotation((JavaResourceAbstractType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlRootElementAnnotation.ANNOTATION_NAME;
- }
-
-}
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 0ac46c3036..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-
-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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSchemaAnnotation((JavaResourcePackage) parent, (AnnotatedPackage) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlSchemaAnnotation((JavaResourcePackage) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- // TODO
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-}
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 385af2b93c..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 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-
-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 NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlSchemaTypeAnnotation.buildSourceXmlSchemaTypeAnnotation(parent, annotatedElement, index);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- throw new UnsupportedOperationException();
- }
-
- 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;
- }
-}
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 b4a3b98ed5..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.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSeeAlsoAnnotation((JavaResourceAbstractType) parent, (AbstractType) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlSeeAlsoAnnotation((JavaResourceAbstractType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlSeeAlsoAnnotation.ANNOTATION_NAME;
- }
-
-}
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 2f40820e51..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransientAnnotation((JavaResourceMember) parent, (Member) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransientAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlTransientAnnotation.ANNOTATION_NAME;
- }
-
-}
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 0ab260ff21..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.utility.jdt.AbstractType;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTypeAnnotation((JavaResourceAbstractType) parent, (AbstractType) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlTypeAnnotation((JavaResourceAbstractType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTypeAnnotation((JavaResourceAbstractType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlTypeAnnotation.ANNOTATION_NAME;
- }
-
-}
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 cf706d63d8..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.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * 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 Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlValueAnnotation((JavaResourceMember) parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlValueAnnotation((JavaResourceMember) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return XmlValueAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java
deleted file mode 100644
index 5dd44ff4c6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.IMemberValuePair;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-
-/**
- * JAR annotation
- */
-public abstract class BinaryAnnotation
- extends BinaryNode
- implements Annotation
-{
- final IAnnotation jdtAnnotation;
-
- protected BinaryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent);
- this.jdtAnnotation = jdtAnnotation;
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return the values of the JDT annotation's member with the specified name.
- */
- protected Object[] getJdtMemberValues(String memberName) {
- Object[] values = (Object[]) this.getJdtMemberValue(memberName);
- return (values != null) ? values : EMPTY_OBJECT_ARRAY;
- }
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- /**
- * Return the value of the JDT annotation's member with the specified name.
- */
- protected Object getJdtMemberValue(String memberName) {
- IMemberValuePair pair = this.getJdtMemberValuePair(memberName);
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * Return the JDT annotation's member-value pair with the specified name.
- */
- private IMemberValuePair getJdtMemberValuePair(String memberName) {
- for (IMemberValuePair pair : this.getJdtMemberValuePairs()) {
- if (pair.getMemberName().equals(memberName)) {
- return pair;
- }
- }
- return null;
- }
-
- private IMemberValuePair[] getJdtMemberValuePairs() {
- try {
- return this.jdtAnnotation.getMemberValuePairs();
- } catch (JavaModelException ex) {
- JptJaxbCorePlugin.log(ex);
- return EMPTY_MEMBER_VALUE_PAIR_ARRAY;
- }
- }
- private static final IMemberValuePair[] EMPTY_MEMBER_VALUE_PAIR_ARRAY = new IMemberValuePair[0];
-
-
- // ********** Annotation implementation **********
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- // ********** NestableAnnotation implementation **********
- public void moveAnnotation(@SuppressWarnings("unused") 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/BinaryNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java
deleted file mode 100644
index 653f1bdc2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.AbstractJavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-
-/**
- * Binary convenience methods
- */
-// TODO hopefully this class can go away with some sort of refactoring of the
-// source and binary hierarchies...
-public abstract class BinaryNode
- extends AbstractJavaResourceNode
-{
-
- // ********** construction **********
-
- protected BinaryNode(JavaResourceNode parent) {
- super(parent);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- @Override
- public IFile getFile() {
- return null; // only BinaryPackageFragmentRoot has a file...
- }
-
- public void update() {
- // nothing by default
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void initialize(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void synchronizeWith(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/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 651dbc16eb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,71 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-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 ANNOTATION_NAME;
- }
-
- @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 4b4d94ecc9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,71 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-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 ANNOTATION_NAME;
- }
-
- @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 4bfd81dbd9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class BinaryXmlAnyAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAnyAttributeAnnotation
-{
-
- public BinaryXmlAnyAttributeAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 09bd4937e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,107 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-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(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.lax = this.buildLax();
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 decc7a278a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class BinaryXmlAttachmentRefAnnotation
- extends BinaryAnnotation
- implements XmlAttachmentRefAnnotation
-{
-
- public BinaryXmlAttachmentRefAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 44f0d3e9f9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,125 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-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(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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();
- }
-
- // ***** 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();
- }
-
- // ***** 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 7e83bef0b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
+++ /dev/null
@@ -1,210 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-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 ANNOTATION_NAME;
- }
-
- @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();
- }
-
- // ***** 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();
- }
-
- // ***** 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 3f418fa470..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,209 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class BinaryXmlElementDeclAnnotation
- extends BinaryAnnotation
- implements XmlElementDeclAnnotation
-{
- private String name;
- private String namespace;
- private String defaultValue;
- private String scope;
- private String substitutionHeadName;
- private String substitutionHeadNamespace;
-
-
- public BinaryXmlElementDeclAnnotation(JavaResourceMethod parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.defaultValue = this.buildDefaultValue();
- this.scope = this.buildScope();
- this.substitutionHeadName = this.buildSubstitutionHeadName();
- this.substitutionHeadNamespace = this.buildSubstitutionHeadNamespace();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setDefaultValue_(this.buildDefaultValue());
- this.setScope_(this.buildScope());
- this.setSubstitutionHeadName_(this.buildSubstitutionHeadName());
- this.setSubstitutionHeadNamespace_(this.buildSubstitutionHeadNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementDeclAnnotation 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_DECL__NAME);
- }
-
- public TextRange getNameTextRange(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_DECL__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(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_DECL__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(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;
- this.firePropertyChanged(SCOPE_PROPERTY, old, scope);
- this.firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, scope);
- }
-
- private String buildScope() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SCOPE);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified scope class name
- public String getFullyQualifiedScopeClassName() {
- return this.scope;
- }
-
- // ***** 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;
- this.firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, substitutionHeadName);
- }
-
- private String buildSubstitutionHeadName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** 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;
- this.firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, substitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(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 685e505318..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,132 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-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 String type;
-
-
- public BinaryXmlElementRefAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- 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();
- }
-
- // ***** 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();
- }
-
- // ***** 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/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 942fcb50eb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,151 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-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(JavaResourceMember 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 ANNOTATION_NAME;
- }
-
- @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();
- }
-
- // ***** 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();
- }
-
- // ***** 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 9cfa9a45a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.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.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.JavaResourceAttribute;
-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(JavaResourceAttribute 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 ANNOTATION_NAME;
- }
-
- 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 e073b9ca1e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
+++ /dev/null
@@ -1,80 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-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(JavaResourceAbstractType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 e726a7a6c7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.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.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.JavaResourceEnumConstant;
-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(JavaResourceEnumConstant parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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();
- }
-
-}
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 cbc80e7c93..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class BinaryXmlIDAnnotation
- extends BinaryAnnotation
- implements XmlIDAnnotation
-{
-
- public BinaryXmlIDAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 76fab01bb1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class BinaryXmlIDREFAnnotation
- extends BinaryAnnotation
- implements XmlIDREFAnnotation
-{
-
- public BinaryXmlIDREFAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 c06a25dc4d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class BinaryXmlInlineBinaryDataAnnotation
- extends BinaryAnnotation
- implements XmlInlineBinaryDataAnnotation
-{
-
- public BinaryXmlInlineBinaryDataAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 5ebee1b2f3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,111 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-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 ANNOTATION_NAME;
- }
-
- @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 e41b57feb9..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.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class BinaryXmlListAnnotation
- extends BinaryAnnotation
- implements XmlListAnnotation
-{
-
- public BinaryXmlListAnnotation(JavaResourceMember
- parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 a7fd90a62e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.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.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.JavaResourceMember;
-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(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 3897ba916d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class BinaryXmlMixedAnnotation
- extends BinaryAnnotation
- implements XmlMixedAnnotation
-{
-
- public BinaryXmlMixedAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 62db135eeb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class BinaryXmlRegistryAnnotation
- extends BinaryAnnotation
- implements XmlRegistryAnnotation
-{
-
- public BinaryXmlRegistryAnnotation(JavaResourceAbstractType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 6ec68ce24d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,109 +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.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-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(JavaResourceAbstractType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 4603000057..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.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.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-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.JavaResourceAbstractType;
-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(JavaResourceAbstractType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.classes = this.buildClasses();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @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 81c43cbd10..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class BinaryXmlTransientAnnotation
- extends BinaryAnnotation
- implements XmlTransientAnnotation
-{
-
- public BinaryXmlTransientAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
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 d9f5c8cbbe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.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.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.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.JavaResourceAbstractType;
-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(JavaResourceAbstractType 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 ANNOTATION_NAME;
- }
-
- @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();
- }
-
-}
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 d07f3d990c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.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.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class BinaryXmlValueAnnotation
- extends BinaryAnnotation
- implements XmlValueAnnotation
-{
-
- public BinaryXmlValueAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java
deleted file mode 100644
index c2ddcd153b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * 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.core.resources.IFile;
-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.AnnotationProvider;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-
-/**
- * Java resource containment hierarchy
- */
-public abstract class AbstractJavaResourceNode
- extends AbstractModel
- implements JavaResourceNode
-{
- protected final JavaResourceNode parent;
-
-
- // ********** constructor **********
-
- protected AbstractJavaResourceNode(JavaResourceNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- protected JavaResourceNode getParent() {
- return this.parent;
- }
-
- // ********** parent **********
-
- protected void checkParent(JavaResourceNode 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
- }
-
-
- // ********** change support callback hook **********
-
- @Override
- protected final ChangeSupport buildChangeSupport() {
- return new AspectChangeSupport(this, this.buildChangeSupportListener());
- }
-
- private AspectChangeSupport.Listener buildChangeSupportListener() {
- return new AspectChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJavaResourceNode.this.aspectChanged(aspectName);
- }
- };
- }
-
- /**
- * ignore the aspect name, we notify listeners of *every* change
- */
- protected void aspectChanged(@SuppressWarnings("unused") String aspectName) {
- this.getRoot().resourceModelChanged();
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- /**
- * @see org.eclipse.jpt.core.internal.resource.java.source.SourceCompilationUnit#getRoot()
- * @see org.eclipse.jpt.core.internal.resource.java.binary.BinaryPackageFragmentRoot#getRoot()
- * @see org.eclipse.jpt.core.internal.resource.java.binary.BinaryPersistentTypeCache#getRoot()
- */
- public Root getRoot() {
- return this.parent.getRoot();
- }
-
- public IFile getFile() {
- return this.getRoot().getFile();
- }
-
-
- // ********** convenience methods **********
-
- protected AnnotationProvider getAnnotationProvider() {
- return this.getRoot().getAnnotationProvider();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAbstractType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAbstractType.java
deleted file mode 100644
index 543b40493b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAbstractType.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.HashMap;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.SimpleIntReference;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-
-/**
- * Java source type
- */
-abstract class SourceAbstractType<A extends AbstractType>
- extends SourceMember<A>
- implements JavaResourceAbstractType
-{
- private String name;
-
- private String qualifiedName;
-
- private String packageName;
-
- private String declaringTypeName;
-
- private boolean memberType;
-
-
- // ********** construction/initialization **********
-
- protected SourceAbstractType(JavaResourceCompilationUnit javaResourceCompilationUnit, A type) {
- super(javaResourceCompilationUnit, type);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.name = this.buildName(binding);
- this.qualifiedName = this.buildQualifiedName(binding);
- this.packageName = this.buildPackageName(binding);
- this.declaringTypeName = this.buildDeclaringTypeName(binding);
- this.memberType = this.buildMemberType(binding);
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncName(this.buildName(binding));
- this.syncQualifiedName(this.buildQualifiedName(binding));
- this.syncPackageName(this.buildPackageName(binding));
- this.syncDeclaringTypeName(this.buildDeclaringTypeName(binding));
- this.syncMemberType(this.buildMemberType(binding));
- }
-
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ******** JavaResourceAbstractType implementation ********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getName();
- }
-
- // ***** qualified name
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- private void syncQualifiedName(String astQualifiedName) {
- String old = this.qualifiedName;
- this.qualifiedName = astQualifiedName;
- this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, astQualifiedName);
- }
-
- private String buildQualifiedName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getQualifiedName();
- }
-
- // ***** package name
- public String getPackageName() {
- return this.packageName;
- }
-
- private void syncPackageName(String astPackageName) {
- String old = this.packageName;
- this.packageName = astPackageName;
- this.firePropertyChanged(PACKAGE_NAME_PROPERTY, old, astPackageName);
- }
-
- private String buildPackageName(ITypeBinding binding) {
- return (binding == null) ? null : binding.getPackage().getName();
- }
-
- // ***** package
- public boolean isIn(IPackageFragment packageFragment) {
- return StringTools.stringsAreEqual(packageFragment.getElementName(), this.packageName);
- }
-
- // ***** declaring type name
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- private void syncDeclaringTypeName(String astDeclaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = astDeclaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, astDeclaringTypeName);
- }
-
- private String buildDeclaringTypeName(ITypeBinding binding) {
- if (binding == null) {
- return null;
- }
- ITypeBinding declaringClass = binding.getDeclaringClass();
- return (declaringClass == null) ? null : declaringClass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** member type
- public boolean isMemberType() {
- return this.memberType;
- }
-
- private void syncMemberType(boolean memberType) {
- boolean old = this.memberType;
- this.memberType = memberType;
- this.firePropertyChanged(MEMBER_TYPE_PROPERTY, old, memberType);
- }
-
- private boolean buildMemberType(ITypeBinding binding) {
- return (binding == null) ? false : binding.isMember();
- }
-
- public boolean isMapped() {
- return ! CollectionTools.isEmpty(getAnnotations());
- }
-
-
- // ********** CounterMap **********
-
- protected static class CounterMap {
- private final HashMap<Object, SimpleIntReference> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, SimpleIntReference>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- SimpleIntReference counter = this.counters.get(o);
- if (counter == null) {
- counter = new SimpleIntReference();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.getValue();
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java
deleted file mode 100644
index f92161e939..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java
+++ /dev/null
@@ -1,500 +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.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-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.LiveCloneIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-
-/**
- * Java source annotated element (annotations)
- */
-abstract class SourceAnnotatedElement<A extends AnnotatedElement>
- extends SourceNode
- implements JavaResourceAnnotatedElement
-{
- final A annotatedElement;
-
- /**
- * annotations; no duplicates (java compiler has an error for duplicates)
- */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- /**
- * Annotation containers keyed on nestable annotation name.
- * This is used to store annotations that can be both standalone and nested
- * and are moved back and forth between the 2.
- */
- final Map<String, AnnotationContainer> annotationContainers = new HashMap<String, AnnotationContainer>();
-
- // ********** construction/initialization **********
-
- SourceAnnotatedElement(JavaResourceNode parent, A annotatedElement) {
- super(parent);
- this.annotatedElement = annotatedElement;
- }
-
- public void initialize(CompilationUnit astRoot) {
- ASTNode node = this.annotatedElement.getBodyDeclaration(astRoot);
- node.accept(this.buildInitialAnnotationVisitor(node));
- }
-
- private ASTVisitor buildInitialAnnotationVisitor(ASTNode node) {
- return new InitialAnnotationVisitor(node);
- }
-
- /**
- * called from {@link InitialAnnotationVisitor}
- */
- /* private */ void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- String jdtAnnotationName = ASTTools.resolveAnnotation(node);
- if (jdtAnnotationName != null) {
- if (this.annotationIsValid(jdtAnnotationName)) {
- if (this.selectAnnotationNamed(this.annotations, jdtAnnotationName) == null) { // ignore duplicates
- Annotation annotation = this.buildAnnotation(jdtAnnotationName);
- annotation.initialize((CompilationUnit) node.getRoot());
- this.annotations.add(annotation);
- }
- }
- else if(this.annotationIsValidNestable(jdtAnnotationName)) {
- AnnotationContainer container = new AnnotationContainer(jdtAnnotationName);
- container.initializeNestableAnnotation(node);
- this.annotationContainers.put(jdtAnnotationName, container);
- }
- else if(this.annotationIsValidContainer(jdtAnnotationName)) {
- String nestableAnnotationName = this.getNestableAnnotationName(jdtAnnotationName);
- AnnotationContainer container = new AnnotationContainer(nestableAnnotationName);
- container.initialize(node);
- this.annotationContainers.put(nestableAnnotationName, container);
- }
- }
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncAnnotations(this.annotatedElement.getBodyDeclaration(astRoot));
- }
-
-
- // ********** annotations **********
-
- public Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int getAnnotationsSize() {
- return this.annotations.size();
- }
-
- public Annotation getAnnotation(String annotationName) {
- return this.selectAnnotationNamed(this.getAnnotations(), annotationName);
- }
-
- public Annotation getNonNullAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- return (annotation != null) ? annotation : this.buildNullAnnotation(annotationName);
- }
-
- public ListIterable<NestableAnnotation> getAnnotations(String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container != null ? container.getNestedAnnotations() : EmptyListIterable.<NestableAnnotation> instance();
- }
-
- public int getAnnotationsSize(String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container == null ? 0 : container.getNestedAnnotationsSize();
- }
-
- public NestableAnnotation getAnnotation(int index, String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- return container == null ? null : container.nestedAnnotationAt(index);
- }
-
- private String getNestableAnnotationName(String containerAnnotationName) {
- return getAnnotationProvider().getNestableAnnotationName(containerAnnotationName);
- }
-
- private String getNestableElementName(String nestableAnnotationName) {
- return getAnnotationProvider().getNestableElementName(nestableAnnotationName);
- }
-
- public Annotation addAnnotation(String annotationName) {
- Annotation annotation = this.buildAnnotation(annotationName);
- this.annotations.add(annotation);
- annotation.newAnnotation();
- return annotation;
- }
-
- /**
- * 1. check for a container annotation;
- * if it is present, add a nested annotation to it
- * 2. check for a stand-alone nested annotation;
- * if it is missing, add a stand-alone nested annotation
- * 3. if there is an existing stand-alone nested annotation,
- * add a container annotation and move the stand-alone nested annotation to it
- * and add a new nested annotation to it also
- */
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- if (container == null) {
- container = new AnnotationContainer(nestableAnnotationName);
- this.annotationContainers.put(nestableAnnotationName, container);
- }
- return container.addNestedAnnotation(index);
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String nestableAnnotationName) {
- this.annotationContainers.get(nestableAnnotationName).moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeAnnotation(String annotationName) {
- Annotation annotation = this.getAnnotation(annotationName);
- if (annotation != null) {
- this.removeAnnotation(annotation);
- }
- }
-
- private void removeAnnotation(Annotation annotation) {
- this.annotations.remove(annotation);
- annotation.removeAnnotation();
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName) {
- this.annotationContainers.get(nestableAnnotationName).removeNestedAnnotation(index);
- }
-
- private boolean annotationIsValid(String annotationName) {
- return CollectionTools.contains(this.getValidAnnotationNames(), annotationName);
- }
-
- private boolean annotationIsValidContainer(String annotationName) {
- return CollectionTools.contains(this.getValidContainerAnnotationNames(), annotationName);
- }
-
- private boolean annotationIsValidNestable(String annotationName) {
- return CollectionTools.contains(this.getValidNestableAnnotationNames(), annotationName);
- }
-
- Iterable<String> getValidAnnotationNames() {
- return this.getAnnotationProvider().getAnnotationNames();
- }
-
- Iterable<String> getValidContainerAnnotationNames() {
- return this.getAnnotationProvider().getContainerAnnotationNames();
- }
-
- Iterable<String> getValidNestableAnnotationNames() {
- return this.getAnnotationProvider().getNestableAnnotationNames();
- }
-
- Annotation buildAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildAnnotation(this, this.annotatedElement, annotationName);
- }
-
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullAnnotation(this, annotationName);
- }
-
- NestableAnnotation buildNestableAnnotation(String annotationName, int index) {
- return this.getAnnotationProvider().buildAnnotation(this, this.annotatedElement, annotationName, index);
- }
-
- private void syncAnnotations(ASTNode node) {
- HashSet<Annotation> annotationsToRemove = new HashSet<Annotation>(this.annotations);
-
- HashSet<AnnotationContainer> containersToRemove = new HashSet<AnnotationContainer>(this.annotationContainers.values());
- node.accept(this.buildSynchronizeAnnotationVisitor(node, annotationsToRemove, containersToRemove));
-
- for (Annotation annotation : annotationsToRemove) {
- this.removeItemFromCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
-
- for (AnnotationContainer annotationContainer : containersToRemove) {
- this.annotationContainers.remove(annotationContainer.getNestedAnnotationName());
- fireItemsRemoved(NESTABLE_ANNOTATIONS_COLLECTION, CollectionTools.collection(annotationContainer.getNestedAnnotations()));
- }
-
- Iterator<String> keys = this.annotationContainers.keySet().iterator();
-
- while (keys.hasNext()) {
- String annotationName = keys.next();
- if (this.annotationContainers.get(annotationName).getNestedAnnotationsSize() == 0) {
- keys.remove();
- }
- }
- }
-
- private ASTVisitor buildSynchronizeAnnotationVisitor(ASTNode node, Set<Annotation> annotationsToRemove, Set<AnnotationContainer> containersToRemove) {
- return new SynchronizeAnnotationVisitor(node, annotationsToRemove, containersToRemove);
- }
-
- /**
- * called from {@link SynchronizeAnnotationVisitor}
- */
- /* private */ void addOrSyncAnnotation(org.eclipse.jdt.core.dom.Annotation node, Set<Annotation> annotationsToRemove, Set<AnnotationContainer> containersToRemove) {
- String jdtAnnotationName = ASTTools.resolveAnnotation(node);
- if (jdtAnnotationName != null) {
- if (this.annotationIsValid(jdtAnnotationName)) {
- this.addOrSyncAnnotation_(node, jdtAnnotationName, annotationsToRemove);
- }
- else if(this.annotationIsValidNestable(jdtAnnotationName)) {
- this.addOrSyncNestableAnnotation_(node, jdtAnnotationName, containersToRemove);
- }
- else if(this.annotationIsValidContainer(jdtAnnotationName)) {
- this.addOrSyncContainerAnnotation_(node, jdtAnnotationName, containersToRemove);
- }
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is valid
- */
- private void addOrSyncAnnotation_(org.eclipse.jdt.core.dom.Annotation node, String jdtAnnotationName, Set<Annotation> annotationsToRemove) {
- Annotation annotation = this.selectAnnotationNamed(annotationsToRemove, jdtAnnotationName);
- if (annotation != null) {
- annotation.synchronizeWith((CompilationUnit) node.getRoot());
- annotationsToRemove.remove(annotation);
- } else {
- annotation = this.buildAnnotation(jdtAnnotationName);
- annotation.initialize((CompilationUnit) node.getRoot());
- this.addItemToCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is valid
- */
- private void addOrSyncNestableAnnotation_(org.eclipse.jdt.core.dom.Annotation node, String nestableAnnotationName, Set<AnnotationContainer> containersToRemove) {
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- if (container != null) {
- container.synchronizeNestableAnnotation(node);
- containersToRemove.remove(container);
- }
- else {
- container = new AnnotationContainer(nestableAnnotationName);
- container.initializeNestableAnnotation(node);
- this.annotationContainers.put(nestableAnnotationName, container);
- this.fireItemAdded(NESTABLE_ANNOTATIONS_COLLECTION, container.nestedAnnotationAt(0));
- }
- }
-
- /**
- * pre-condition: node is valid container annotation
- */
- private void addOrSyncContainerAnnotation_(org.eclipse.jdt.core.dom.Annotation node, String containerAnnotationName, Set<AnnotationContainer> containersToRemove) {
- String nestableAnnotationName = this.getNestableAnnotationName(containerAnnotationName);
- AnnotationContainer container = this.annotationContainers.get(nestableAnnotationName);
- if (container == null) {
- container = new AnnotationContainer(nestableAnnotationName);
- container.initialize(node);
- this.annotationContainers.put(nestableAnnotationName, container);
- this.fireItemsAdded(NESTABLE_ANNOTATIONS_COLLECTION, CollectionTools.collection(container.getNestedAnnotations()));
- }
- else {
- container.synchronize(node);
- containersToRemove.remove(container);
- }
- }
-
-
- // ********** miscellaneous **********
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty() || ! this.annotationContainers.isEmpty();
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return this.fullTextRange(astRoot);
- }
-
- private TextRange fullTextRange(CompilationUnit astRoot) {
- return this.buildTextRange(this.annotatedElement.getBodyDeclaration(astRoot));
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.annotatedElement.getNameTextRange(astRoot);
- }
-
- private Annotation selectAnnotationNamed(Iterable<Annotation> list, String annotationName) {
- for (Annotation annotation : list) {
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- private TextRange buildTextRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
-
- // ********** AST visitors **********
-
- /**
- * annotation visitor
- */
- protected static abstract class AnnotationVisitor
- extends ASTVisitor
- {
- protected final ASTNode node;
-
-
- protected AnnotationVisitor(ASTNode node) {
- super();
- this.node = node;
- }
-
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return this.visit_(node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return this.visit_(node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return this.visit_(node);
- }
-
- protected boolean visit_(org.eclipse.jdt.core.dom.Annotation node) {
- // ignore annotations for child members, only this member
- if (node.getParent() == this.node) {
- this.visitChildAnnotation(node);
- }
- return false;
- }
-
- protected abstract void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node);
- }
-
-
- /**
- * initial annotation visitor
- */
- protected class InitialAnnotationVisitor
- extends AnnotationVisitor
- {
- protected InitialAnnotationVisitor(ASTNode node) {
- super(node);
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- SourceAnnotatedElement.this.addInitialAnnotation(node);
- }
- }
-
-
- /**
- * synchronize annotation visitor
- */
- protected class SynchronizeAnnotationVisitor
- extends AnnotationVisitor
- {
- protected final Set<Annotation> annotationsToRemove;
- protected final Set<AnnotationContainer> containersToRemove;
-
- protected SynchronizeAnnotationVisitor(ASTNode node, Set<Annotation> annotationsToRemove, Set<AnnotationContainer> containersToRemove) {
- super(node);
- this.annotationsToRemove = annotationsToRemove;
- this.containersToRemove = containersToRemove;
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- SourceAnnotatedElement.this.addOrSyncAnnotation(node, this.annotationsToRemove, this.containersToRemove);
- }
- }
-
-
- class AnnotationContainer extends SourceNode.AnnotationContainer<NestableAnnotation>
- {
- private final String nestableAnnotationName;
-
- protected AnnotationContainer(String nestableAnnotationName) {
- super();
- this.nestableAnnotationName = nestableAnnotationName;
- }
-
- /**
- * Return the element name of the nested annotations
- */
- @Override
- protected String getElementName() {
- return SourceAnnotatedElement.this.getNestableElementName(this.nestableAnnotationName);
- }
-
- /**
- * Return the nested annotation name
- */
- @Override
- protected String getNestedAnnotationName() {
- return this.nestableAnnotationName;
- }
-
- /**
- * Return a new nested annotation at the given index
- */
- @Override
- protected NestableAnnotation buildNestedAnnotation(int index) {
- return SourceAnnotatedElement.this.buildNestableAnnotation(this.nestableAnnotationName, index);
- }
-
- public void initializeNestableAnnotation(org.eclipse.jdt.core.dom.Annotation standaloneNestableAnnotation) {
- NestableAnnotation nestedAnnotation = this.buildNestedAnnotation(0);
- this.nestedAnnotations.add(nestedAnnotation);
- nestedAnnotation.initialize((CompilationUnit) standaloneNestableAnnotation.getRoot());
- }
-
- public void synchronizeNestableAnnotation(org.eclipse.jdt.core.dom.Annotation standaloneNestableAnnotation) {
- if (this.getNestedAnnotationsSize() > 1) {
- //ignore the new standalone annotation as a container annotation already exists
- }
- else if (this.getNestedAnnotationsSize() == 1) {
- this.nestedAnnotationAt(0).synchronizeWith((CompilationUnit) standaloneNestableAnnotation.getRoot());
- }
- }
-
- @Override
- protected void fireItemAdded(int index, NestableAnnotation nestedAnnotation) {
- SourceAnnotatedElement.this.fireItemAdded(NESTABLE_ANNOTATIONS_COLLECTION, nestedAnnotation);
- }
-
- @Override
- protected void fireItemsRemoved(int index, List<NestableAnnotation> removedItems) {
- SourceAnnotatedElement.this.fireItemsRemoved(NESTABLE_ANNOTATIONS_COLLECTION, removedItems);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java
deleted file mode 100644
index db2e0b4f22..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java
+++ /dev/null
@@ -1,175 +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.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-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.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-
-/**
- * some common state and behavior for Java source annotations;
- * and lots of convenience methods
- */
-public abstract class SourceAnnotation<A extends AnnotatedElement>
- extends SourceNode
- implements Annotation
-{
- protected final A annotatedElement;
-
- protected final DeclarationAnnotationAdapter daa;
-
- protected final AnnotationAdapter annotationAdapter;
-
-
- /**
- * constructor for straight member annotation
- */
- protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa) {
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- /**
- * constructor for nested annotation (typically)
- */
- protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent);
- this.annotatedElement = annotatedElement;
- this.daa = daa;
- this.annotationAdapter = annotationAdapter;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return this.getAnnotationTextRange(astRoot);
- }
-
-
- // ********** Annotation implementation **********
-
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return this.annotationAdapter.getAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- this.annotationAdapter.newMarkerAnnotation();
- }
-
- public void removeAnnotation() {
- this.annotationAdapter.removeAnnotation();
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return the text range corresponding to the annotation.
- * If the annotation is missing, return null.
- */
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getAstAnnotation(astRoot));
- }
-
- /**
- * Convenience method.
- * Return the text range corresponding to the specified element.
- * If the specified element is missing, return the annotation's text range instead.
- */
- protected TextRange getElementTextRange(DeclarationAnnotationElementAdapter<?> elementAdapter, CompilationUnit astRoot) {
- return this.getElementTextRange(this.getAnnotationElementTextRange(elementAdapter, astRoot), astRoot);
- }
-
- /**
- * Convenience method. If the specified element text range is null
- * return the member's text range instead.
- */
- protected TextRange getElementTextRange(TextRange elementTextRange, CompilationUnit astRoot) {
- return (elementTextRange != null) ? elementTextRange : this.getAnnotationTextRange(astRoot);
- }
-
- /**
- * Convenience method. Return whether the specified position exists and
- * touches the specified element.
- */
- protected boolean elementTouches(DeclarationAnnotationElementAdapter<?> elementAdapter, int pos, CompilationUnit astRoot) {
- return this.textRangeTouches(this.getAnnotationElementTextRange(elementAdapter, astRoot), pos);
- }
-
- /**
- * Convenience method. Return whether the specified text range is not
- * null (meaning the corresponding AST node exists) and the specified position touches it.
- */
- protected boolean textRangeTouches(TextRange textRange, int pos) {
- return (textRange != null) && textRange.touches(pos);
- }
-
- /**
- * Return the text range corresponding to the specified element.
- * If the element is missing, return null.
- */
- protected TextRange getAnnotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return this.getTextRange(this.getAnnotationElementExpression(adapter, astRoot));
- }
-
- /**
- * Return the specified AST DOM element.
- */
- protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot));
- }
-
- /**
- * Return the text range corresponding to the specified AST node.
- * If the AST node is null, return null.
- */
- protected TextRange getTextRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
-
-
- /**
- * A container for nested annotations. The owner of the AnnotationContainer
- * needs to call initialize(CompilationUnit) on it.
- * @param <T> the type of the resource nestable annotations
- */
- abstract class AnnotationContainer<T extends NestableAnnotation> extends SourceNode.AnnotationContainer<T>
- {
- protected AnnotationContainer() {
- super();
- }
-
- /**
- * Return the annotations property name for firing property change notification
- */
- protected abstract String getAnnotationsPropertyName();
-
- @Override
- protected void fireItemAdded(int index, T addedItem) {
- SourceAnnotation.this.fireItemAdded(this.getAnnotationsPropertyName(), index, addedItem);
- }
-
- @Override
- protected void fireItemsRemoved(int index, java.util.List<T> removedItems) {
- SourceAnnotation.this.fireItemsRemoved(this.getAnnotationsPropertyName(), index, removedItems);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java
deleted file mode 100644
index f43d19bf87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.source;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-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.jaxb.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * Java source attribute (field or method)
- */
-abstract class SourceAttribute<A extends Attribute>
- extends SourceMember<A>
- implements JavaResourceAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private boolean typeIsArray;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- protected SourceAttribute(JavaResourceType parent, A attribute){
- super(parent, attribute);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot); //build once, minor performance tweak for major benefit
- this.modifiers = this.buildModifiers(astRoot);
- this.typeName = this.buildTypeName(typeBinding);
- this.typeIsInterface = this.buildTypeIsInterface(typeBinding);
- this.typeIsEnum = this.buildTypeIsEnum(typeBinding);
- this.typeIsArray = this.buildTypeIsArray(typeBinding);
- this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(typeBinding));
- this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(typeBinding));
- this.typeTypeArgumentNames.addAll(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
-
- // ******** overrides ********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
- this.syncTypeName(this.buildTypeName(typeBinding));
- this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
- this.syncModifiers(this.buildModifiers(astRoot));
- this.syncTypeName(this.buildTypeName(typeBinding));
- this.syncTypeIsInterface(this.buildTypeIsInterface(typeBinding));
- this.syncTypeIsEnum(this.buildTypeIsEnum(typeBinding));
- this.syncTypeIsArray(this.buildTypeIsArray(typeBinding));
- this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******** JavaResourcePersistentAttribute implementation ********
-
- public String getName() {
- return this.annotatedElement.getAttributeName();
- }
-
- public boolean typeIsSubTypeOf(String tn) {
- if (this.typeName == null) {
- return false;
- }
- return this.typeName.equals(tn)
- || this.typeInterfaceNames.contains(tn)
- || this.typeSuperclassNames.contains(tn);
- }
-
- public boolean typeIsVariablePrimitive() {
- return (this.typeName != null) && ClassName.isVariablePrimitive(this.typeName);
- }
-
- private ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- return this.annotatedElement.getTypeBinding(astRoot);
- }
-
-
- // ***** modifiers
- public int getModifiers() {
- return this.modifiers;
- }
-
- private void syncModifiers(int astModifiers) {
- int old = this.modifiers;
- this.modifiers = astModifiers;
- this.firePropertyChanged(MODIFIERS_PROPERTY, old, astModifiers);
- }
-
- /**
- * zero seems like a reasonable default...
- */
- private int buildModifiers(CompilationUnit astRoot) {
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- return (binding == null) ? 0 : binding.getModifiers();
- }
-
- // ***** type name
- public String getTypeName() {
- return this.typeName;
- }
-
- private void syncTypeName(String astTypeName) {
- String old = this.typeName;
- this.typeName = astTypeName;
- this.firePropertyChanged(TYPE_NAME_PROPERTY, old, astTypeName);
- }
-
- /**
- * this can be an array (e.g. "java.lang.String[]");
- * but no generic type arguments
- */
- private String buildTypeName(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return null;
- }
- // a type variable is what is declared by a generic type;
- // e.g. "E" is a type variable declared by the generic type "Collection" in
- // public interface Collection<E>
- if (typeBinding.isTypeVariable()) {
- // e.g. "E extends Number" has an erasure of "Number"
- typeBinding = typeBinding.getErasure();
- }
- String tbName = typeBinding.getTypeDeclaration().getQualifiedName();
- return (tbName.length() == 0) ? null : tbName;
- }
-
- // ***** type is interface
- public boolean typeIsInterface() {
- return this.typeIsInterface;
- }
-
- private void syncTypeIsInterface(boolean astTypeIsInterface) {
- boolean old = this.typeIsInterface;
- this.typeIsInterface = astTypeIsInterface;
- this.firePropertyChanged(TYPE_IS_INTERFACE_PROPERTY, old, astTypeIsInterface);
- }
-
- private boolean buildTypeIsInterface(ITypeBinding typeBinding) {
- return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isInterface();
- }
-
- // ***** type is enum
- public boolean typeIsEnum() {
- return this.typeIsEnum;
- }
-
- private void syncTypeIsEnum(boolean astTypeIsEnum) {
- boolean old = this.typeIsEnum;
- this.typeIsEnum = astTypeIsEnum;
- this.firePropertyChanged(TYPE_IS_ENUM_PROPERTY, old, astTypeIsEnum);
- }
-
- private boolean buildTypeIsEnum(ITypeBinding typeBinding) {
- return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isEnum();
- }
-
- // ***** type is array
- public boolean typeIsArray() {
- return this.typeIsArray;
- }
-
- private void syncTypeIsArray(boolean astTypeIsArray) {
- boolean old = this.typeIsArray;
- this.typeIsArray = astTypeIsArray;
- this.firePropertyChanged(TYPE_IS_ARRAY_PROPERTY, old, astTypeIsArray);
- }
-
- private boolean buildTypeIsArray(ITypeBinding typeBinding) {
- return (typeBinding != null) && typeBinding.isArray();
- }
-
- // ***** type superclass hierarchy
- public ListIterable<String> getTypeSuperclassNames() {
- return new LiveCloneListIterable<String>(this.typeSuperclassNames);
- }
-
- private void syncTypeSuperclassNames(List<String> astTypeSuperclassNames) {
- this.synchronizeList(astTypeSuperclassNames, this.typeSuperclassNames, TYPE_SUPERCLASS_NAMES_LIST);
- }
-
- private List<String> buildTypeSuperclassNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptyList();
- }
- ArrayList<String> names = new ArrayList<String>();
- typeBinding = typeBinding.getSuperclass();
- while (typeBinding != null) {
- names.add(typeBinding.getQualifiedName());
- typeBinding = typeBinding.getSuperclass();
- }
- return names;
- }
-
- // ***** type interface hierarchy
- public Iterable<String> getTypeInterfaceNames() {
- return new LiveCloneIterable<String>(this.typeInterfaceNames);
- }
-
-// private boolean typeInterfaceNamesContains(String interfaceName) {
-// return this.typeInterfaceNames.contains(interfaceName);
-// }
-//
- private void syncTypeInterfaceNames(Collection<String> astTypeInterfaceNames) {
- this.synchronizeCollection(astTypeInterfaceNames, this.typeInterfaceNames, TYPE_INTERFACE_NAMES_COLLECTION);
- }
-
- private Collection<String> buildTypeInterfaceNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptySet();
- }
- HashSet<String> names = new HashSet<String>();
- while (typeBinding != null) {
- this.addInterfaceNamesTo(typeBinding, names);
- typeBinding = typeBinding.getSuperclass();
- }
- return names;
- }
-
- private void addInterfaceNamesTo(ITypeBinding typeBinding, HashSet<String> names) {
- for (ITypeBinding interfaceBinding : typeBinding.getInterfaces()) {
- names.add(interfaceBinding.getTypeDeclaration().getQualifiedName());
- this.addInterfaceNamesTo(interfaceBinding, names); // recurse
- }
- }
-
- // ***** type type argument names
- public ListIterable<String> getTypeTypeArgumentNames() {
- return new LiveCloneListIterable<String>(this.typeTypeArgumentNames);
- }
-
- public int getTypeTypeArgumentNamesSize() {
- return this.typeTypeArgumentNames.size();
- }
-
- public String getTypeTypeArgumentName(int index) {
- return this.typeTypeArgumentNames.get(index);
- }
-
- private void syncTypeTypeArgumentNames(List<String> astTypeTypeArgumentNames) {
- this.synchronizeList(astTypeTypeArgumentNames, this.typeTypeArgumentNames, TYPE_TYPE_ARGUMENT_NAMES_LIST);
- }
-
- /**
- * these types can be arrays (e.g. "java.lang.String[]");
- * but they won't have any further nested generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>")
- */
- private List<String> buildTypeTypeArgumentNames(ITypeBinding typeBinding) {
- if (typeBinding == null) {
- return Collections.emptyList();
- }
-
- ITypeBinding[] typeArguments = typeBinding.getTypeArguments();
- if (typeArguments.length == 0) {
- return Collections.emptyList();
- }
-
- ArrayList<String> names = new ArrayList<String>(typeArguments.length);
- for (ITypeBinding typeArgument : typeArguments) {
- if (typeArgument == null) {
- names.add(null);
- } else {
- // e.g. "? extends Number" has an erasure of "Number"
- ITypeBinding erasure = typeArgument.getErasure();
- names.add(erasure.getTypeDeclaration().getQualifiedName());
- }
- }
- return names;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java
deleted file mode 100644
index 7ede5747b6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.jaxb.core.AnnotationProvider;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-
-/**
- * Java compilation unit (source file)
- */
-public abstract class SourceCompilationUnit
- extends SourceNode
- implements JavaResourceCompilationUnit
-{
- /** JDT compilation unit */
- final ICompilationUnit compilationUnit;
-
- /** pluggable annotation provider */
- private final AnnotationProvider annotationProvider;
-
- /** improved annotation formatting */
- private final AnnotationEditFormatter annotationEditFormatter;
-
- /** pluggable executor that allows the document to be modified on another thread */
- private final CommandExecutor modifySharedDocumentCommandExecutor;
-
- /** listeners notified whenever the resource model changes */
- private final ListenerList<JptResourceModelListener> resourceModelListenerList;
-
-
- // ********** construction **********
-
- protected SourceCompilationUnit(
- ICompilationUnit compilationUnit,
- AnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(null); // the JPA compilation unit is the root of its sub-tree
- this.compilationUnit = compilationUnit;
- this.annotationProvider = annotationProvider;
- this.annotationEditFormatter = annotationEditFormatter;
- this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor;
- this.resourceModelListenerList = new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // never called?
- }
-
- void openCompilationUnit() {
- try {
- this.compilationUnit.open(null);
- } catch (JavaModelException ex) {
- // do nothing - we just won't have a primary type in this case
- }
- }
-
- void closeCompilationUnit() {
- try {
- this.compilationUnit.close();
- } catch (JavaModelException ex) {
- // hmmm
- }
- }
-
-
- // ********** AbstractJavaResourceNode overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public JavaResourceCompilationUnit getRoot() {
- return this;
- }
-
- @Override
- public IFile getFile() {
- return (IFile) this.compilationUnit.getResource();
- }
-
- @Override
- public AnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public ICompilationUnit getCompilationUnit() {
- return this.compilationUnit;
- }
-
- public CommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
- public CompilationUnit buildASTRoot() {
- return ASTTools.buildASTRoot(this.compilationUnit);
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWithJavaSource() {
- this.synchronizeWith(this.buildASTRoot());
- }
-
-
- // ********** internal **********
-
- String getCompilationUnitName() {
- return this.removeJavaExtension(this.compilationUnit.getElementName());
- }
-
- private String removeJavaExtension(String fileName) {
- int index = fileName.lastIndexOf(".java"); //$NON-NLS-1$
- return (index == -1) ? fileName : fileName.substring(0, index);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getCompilationUnitName());
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnum.java
deleted file mode 100644
index 0c506206e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnum.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTEnum;
-import org.eclipse.jpt.common.core.utility.jdt.Enum;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.SimpleIntReference;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * Java source type
- */
-final class SourceEnum
- extends SourceAbstractType<Enum>
- implements JavaResourceEnum
-{
-
- private final Vector<JavaResourceEnumConstant> enumConstants;
-
-
-
- // ********** construction/initialization **********
-
- /**
- * build top-level type
- */
- static JavaResourceEnum newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- EnumDeclaration enumDeclaration,
- CompilationUnit astRoot) {
- Enum _enum = new JDTEnum(
- enumDeclaration,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceEnum jre = new SourceEnum(javaResourceCompilationUnit, _enum);
- jre.initialize(astRoot);
- return jre;
- }
-
- /**
- * build nested type
- */
- protected static JavaResourceEnum newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- Type declaringType,
- EnumDeclaration enumDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Enum _enum = new JDTEnum(
- declaringType,
- enumDeclaration,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceEnum jre = new SourceEnum(javaResourceCompilationUnit, _enum);
- jre.initialize(astRoot);
- return jre;
- }
-
- private SourceEnum(JavaResourceCompilationUnit javaResourceCompilationUnit, Enum _enum) {
- super(javaResourceCompilationUnit, _enum);
- this.enumConstants = new Vector<JavaResourceEnumConstant>();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.initializeEnumConstants(astRoot);
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncEnumConstants(astRoot);
- }
-
-
- // ********** SourceAnnotatedElement implementation **********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- for (JavaResourceEnumConstant enumConstant : this.getEnumConstants()) {
- enumConstant.resolveTypes(astRoot);
- }
- }
-
-
- // ******** JavaResourceEnum implementation ********
-
- public Kind getKind() {
- return Kind.ENUM;
- }
-
-
- // ********** enum constants **********
-
- public Iterable<JavaResourceEnumConstant> getEnumConstants() {
- return new LiveCloneIterable<JavaResourceEnumConstant>(this.enumConstants);
- }
-
- private void addEnumConstant(JavaResourceEnumConstant enumConstant) {
- this.addItemToCollection(enumConstant, this.enumConstants, ENUM_CONSTANTS_COLLECTION);
- }
-
- private JavaResourceEnumConstant getEnumConstant(String fieldName, int occurrence) {
- for (JavaResourceEnumConstant enumConstant : this.getEnumConstants()) {
- if (enumConstant.isFor(fieldName, occurrence)) {
- return enumConstant;
- }
- }
- return null;
- }
-
- private void removeEnumConstants(Collection<JavaResourceEnumConstant> remove) {
- this.removeItemsFromCollection(remove, this.enumConstants, ENUM_CONSTANTS_COLLECTION);
- }
-
- private void initializeEnumConstants(CompilationUnit astRoot) {
- EnumConstantDeclaration[] enumConstantDeclarations = this.annotatedElement.getEnumConstants(astRoot);
- CounterMap counters = new CounterMap(enumConstantDeclarations.length);
- for (EnumConstantDeclaration enumConstantDeclaration : enumConstantDeclarations) {
- String constantName = enumConstantDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(constantName);
- this.enumConstants.add(this.buildEnumConstant(constantName, occurrence, astRoot));
- }
- }
-
- private void syncEnumConstants(CompilationUnit astRoot) {
- EnumConstantDeclaration[] enumConstantDeclarations = this.annotatedElement.getEnumConstants(astRoot);
- CounterMap counters = new CounterMap(enumConstantDeclarations.length);
- HashSet<JavaResourceEnumConstant> enumConstantsToRemove = new HashSet<JavaResourceEnumConstant>(this.enumConstants);
- for (EnumConstantDeclaration enumConstantDeclaration : enumConstantDeclarations) {
- String constantName = enumConstantDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(constantName);
-
- JavaResourceEnumConstant enumConstant = this.getEnumConstant(constantName, occurrence);
- if (enumConstant == null) {
- this.addEnumConstant(this.buildEnumConstant(constantName, occurrence, astRoot));
- } else {
- enumConstantsToRemove.remove(enumConstant);
- enumConstant.synchronizeWith(astRoot);
- }
- }
- this.removeEnumConstants(enumConstantsToRemove);
- }
-
- private JavaResourceEnumConstant buildEnumConstant(String fieldName, int occurrence, CompilationUnit astRoot) {
- return SourceEnumConstant.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
-
- public Iterable<JavaResourceType> getTypes() {
- return EmptyIterable.instance();
- }
-
- public Iterable<JavaResourceType> getAllTypes() {
- return EmptyIterable.instance();
- }
-
- public Iterable<JavaResourceEnum> getEnums() {
- return EmptyIterable.instance();
- }
-
- public Iterable<JavaResourceEnum> getAllEnums() {
- return new SingleElementIterable<JavaResourceEnum>(this);
- }
-
- // ********** CounterMap **********
-
- private static class CounterMap {
- private final HashMap<Object, SimpleIntReference> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, SimpleIntReference>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- SimpleIntReference counter = this.counters.get(o);
- if (counter == null) {
- counter = new SimpleIntReference();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.getValue();
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnumConstant.java
deleted file mode 100644
index fec1045317..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceEnumConstant.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTEnumConstant;
-import org.eclipse.jpt.common.core.utility.jdt.Enum;
-import org.eclipse.jpt.common.core.utility.jdt.EnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-
-/**
- * Java source enum constant
- */
-final class SourceEnumConstant
- extends SourceMember<EnumConstant>
- implements JavaResourceEnumConstant
-{
-
- /**
- * construct enum constant
- */
- static JavaResourceEnumConstant newInstance(
- JavaResourceEnum parent,
- Enum declaringEnum,
- String name,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- EnumConstant enumConstant = new JDTEnumConstant(
- declaringEnum,
- name,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceEnumConstant jrec = new SourceEnumConstant(parent, enumConstant);
- jrec.initialize(astRoot);
- return jrec;
- }
-
- private SourceEnumConstant(JavaResourceEnum parent, EnumConstant enumConstant){
- super(parent, enumConstant);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- }
-
-
- // ******** overrides ********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******** JavaResourceEnumConstant implementation ********
-
- public String getName() {
- return this.annotatedElement.getName();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceField.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceField.java
deleted file mode 100644
index 3218f47915..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceField.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * Java source field
- */
-final class SourceField
- extends SourceAttribute<FieldAttribute>
- implements JavaResourceField
-{
-
- /**
- * construct field attribute
- */
- static JavaResourceField newInstance(
- JavaResourceType parent,
- Type declaringType,
- String name,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- FieldAttribute field = new JDTFieldAttribute(
- declaringType,
- name,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceField jrpa = new SourceField(parent, field);
- jrpa.initialize(astRoot);
- return jrpa;
- }
-
- private SourceField(JavaResourceType parent, FieldAttribute field){
- super(parent, field);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java
deleted file mode 100644
index 15a93b2523..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.ArrayList;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-
-/**
- * Java source member (annotations, "persistable")
- */
-abstract class SourceMember<M extends Member>
- extends SourceAnnotatedElement<M>
- implements JavaResourceMember
-{
-
- boolean final_; // 'final' is a reserved word
-
- boolean transient_; // 'transient' is a reserved word
-
- boolean public_; // 'public' is a reserved word
-
- boolean static_; // 'static' is a reserved word
-
-
- // ********** construction/initialization **********
-
- SourceMember(JavaResourceNode parent, M member) {
- super(parent, member);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- this.final_ = this.buildFinal(binding);
- this.transient_ = this.buildTransient(binding);
- this.public_ = this.buildPublic(binding);
- this.static_ = this.buildStatic(binding);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- IBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncFinal(this.buildFinal(binding));
- this.syncTransient(this.buildTransient(binding));
- this.syncPublic(this.buildPublic(binding));
- this.syncStatic(this.buildStatic(binding));
- }
-
-
- // ********** annotations **********
-
- public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- ArrayList<String> annotationNames = new ArrayList<String>();
- CollectionTools.addAll(annotationNames, supportingAnnotationNames);
- if (primaryAnnotationName != null) {
- annotationNames.add(primaryAnnotationName);
- }
- for (Annotation annotation : this.getAnnotations()) {
- if ( ! CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
- this.annotations.remove(annotation);
- annotation.removeAnnotation();
- }
- }
- Annotation newPrimaryAnnotation = null;
- if ((primaryAnnotationName != null) && (this.getAnnotation(primaryAnnotationName) == null)) {
- newPrimaryAnnotation = this.buildAnnotation(primaryAnnotationName);
- this.annotations.add(newPrimaryAnnotation);
- newPrimaryAnnotation.newAnnotation();
- }
- // fire collection change event after all annotation changes are done
- this.fireCollectionChanged(ANNOTATIONS_COLLECTION, this.annotations);
- return newPrimaryAnnotation;
- }
-
-
- // ***** final
- public boolean isFinal() {
- return this.final_;
- }
-
- private void syncFinal(boolean astFinal) {
- boolean old = this.final_;
- this.final_ = astFinal;
- this.firePropertyChanged(FINAL_PROPERTY, old, astFinal);
- }
-
- private boolean buildFinal(IBinding binding) {
- return (binding == null) ? false : Modifier.isFinal(binding.getModifiers());
- }
-
- // ***** transient
- public boolean isTransient() {
- return this.transient_;
- }
-
- private void syncTransient(boolean astTransient) {
- boolean old = this.transient_;
- this.transient_ = astTransient;
- this.firePropertyChanged(TRANSIENT_PROPERTY, old, astTransient);
- }
-
- private boolean buildTransient(IBinding binding) {
- return (binding == null) ? false : Modifier.isTransient(binding.getModifiers());
- }
-
- // ***** public
- public boolean isPublic() {
- return this.public_;
- }
-
- private void syncPublic(boolean astPublic) {
- boolean old = this.public_;
- this.public_ = astPublic;
- this.firePropertyChanged(PUBLIC_PROPERTY, old, astPublic);
- }
-
- private boolean buildPublic(IBinding binding) {
- return (binding == null) ? false : Modifier.isPublic(binding.getModifiers());
- }
-
- // ***** static
- public boolean isStatic() {
- return this.static_;
- }
-
- private void syncStatic(boolean astStatic) {
- boolean old = this.static_;
- this.static_ = astStatic;
- this.firePropertyChanged(STATIC_PROPERTY, old, astStatic);
- }
-
- private boolean buildStatic(IBinding binding) {
- return (binding == null) ? false : Modifier.isStatic(binding.getModifiers());
- }
-
-
- // ********** miscellaneous **********
-
- public boolean isFor(String memberName, int occurrence) {
- return this.annotatedElement.matches(memberName, occurrence);
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMethod.java
deleted file mode 100644
index 5d33f11f35..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMethod.java
+++ /dev/null
@@ -1,154 +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.source;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.MethodSignature;
-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.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * Java source method
- */
-final class SourceMethod
- extends SourceAttribute<MethodAttribute>
- implements JavaResourceMethod
-{
- boolean constructor;
-
- private final Vector<String> parameterTypeNames = new Vector<String>();
-
- /**
- * construct method
- */
- static JavaResourceMethod newInstance(
- JavaResourceType parent,
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- MethodAttribute method = JDTMethodAttribute.newInstance(
- declaringType,
- signature,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceMethod jrm = new SourceMethod(parent, method);
- jrm.initialize(astRoot);
- return jrm;
- }
-
- private SourceMethod(JavaResourceType parent, MethodAttribute method){
- super(parent, method);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- IMethodBinding binding = this.annotatedElement.getBinding(astRoot);
- this.constructor = this.buildConstructor(binding);
- this.parameterTypeNames.addAll(this.buildParameterTypeNames(binding));
- }
-
-
- // ******** overrides ********
-
- @Override
- protected JavaResourceType getParent() {
- return (JavaResourceType) super.getParent();
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- IMethodBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncConstructor(this.buildConstructor(binding));
- this.syncParameterTypeNames(this.buildParameterTypeNames(binding));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getMethodName());
- }
-
-
- // ******** JavaResourceMethod implementation ********
-
- public String getMethodName() {
- return this.annotatedElement.getName();
- }
-
- // ***** constructor
- public boolean isConstructor() {
- return this.constructor;
- }
-
- private void syncConstructor(boolean astConstructor) {
- boolean old = this.constructor;
- this.constructor = astConstructor;
- this.firePropertyChanged(CONSTRUCTOR_PROPERTY, old, astConstructor);
- }
-
- private boolean buildConstructor(IMethodBinding methodBinding) {
- return methodBinding == null ? false : methodBinding.isConstructor();
- }
-
- public boolean isFor(MethodSignature signature, int occurrence) {
- return this.annotatedElement.matches(signature, occurrence);
- }
-
- // ***** parameter type names
- public ListIterable<String> getParameterTypeNames() {
- return new LiveCloneListIterable<String>(this.parameterTypeNames);
- }
-
- public int getParametersSize() {
- return this.parameterTypeNames.size();
- }
-
- private void syncParameterTypeNames(List<String> astParameterTypeNames) {
- this.synchronizeList(astParameterTypeNames, this.parameterTypeNames, PARAMETER_TYPE_NAMES_LIST);
- }
-
- private List<String> buildParameterTypeNames(IMethodBinding methodBinding) {
- if (methodBinding == null) {
- return Collections.emptyList();
- }
- ArrayList<String> names = new ArrayList<String>();
- for (ITypeBinding parameterType : methodBinding.getParameterTypes()) {
- if (parameterType.isTypeVariable()) {
- // e.g. "E extends Number" has an erasure of "Number"
- parameterType = parameterType.getErasure();
- }
- String ptName = parameterType.getTypeDeclaration().getQualifiedName();
- names.add(ptName);
- }
- return names;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java
deleted file mode 100644
index f61cecd321..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java
+++ /dev/null
@@ -1,333 +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.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-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.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
-
-
-/**
- * Source convenience methods
- */
-public abstract class SourceNode
- extends AbstractJavaResourceNode
-{
-
- public SourceNode(JavaResourceNode parent) {
- super(parent);
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- return (JavaResourceCompilationUnit) this.getRoot();
- }
-
- /**
- * A container for nested annotations. The owner of the AnnotationContainer
- * needs to call initialize(org.eclipse.jdt.core.dom.Annotation) on it.
- * @param <T> the type of the resource nestable annotations
- */
- abstract class AnnotationContainer<T extends NestableAnnotation>
- {
- protected final Vector<T> nestedAnnotations = new Vector<T>();
-
- protected AnnotationContainer() {
- super();
- }
-
- /**
- * Return the element name of the nested annotations
- */
- protected abstract String getElementName();
-
- /**
- * Return the nested annotation name
- */
- protected abstract String getNestedAnnotationName();
-
- /**
- * Return a new nested annotation at the given index
- */
- protected abstract T buildNestedAnnotation(int index);
-
- protected abstract void fireItemAdded(int index, T nestedAnnotation);
-
- protected abstract void fireItemsRemoved(int index, List<T> removedItems);
-
- protected void initialize(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- // ignore the nested AST annotations themselves
- // (maybe someday we can use them during initialization...)
- int size = this.getNestedAstAnnotations(astContainerAnnotation).size();
- for (int i = 0; i < size; i++) {
- T nestedAnnotation = this.buildNestedAnnotation(i);
- this.nestedAnnotations.add(i, nestedAnnotation);
- nestedAnnotation.initialize((CompilationUnit) astContainerAnnotation.getRoot());
- }
- }
-
- /**
- * Synchronize the resource model annotations with those in the specified AST.
- * Trigger the appropriate change notification.
- */
- protected void synchronize(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- ArrayList<org.eclipse.jdt.core.dom.Annotation> astAnnotations = this.getNestedAstAnnotations(astContainerAnnotation);
- Iterator<org.eclipse.jdt.core.dom.Annotation> astAnnotationStream = astAnnotations.iterator();
-
- for (T nestedAnnotation : this.getNestedAnnotations()) {
- if (astAnnotationStream.hasNext()) {
- // matching AST annotation is present - synchronize the nested annotation
- astAnnotationStream.next(); // maybe someday we can pass this to the update
- nestedAnnotation.synchronizeWith((CompilationUnit) astContainerAnnotation.getRoot());
- } else {
- // no more AST annotations - remove the remaining nested annotations and exit
- this.syncRemoveNestedAnnotations(astAnnotations.size());
- return;
- }
- }
-
- // add nested annotations for any remaining AST annotations
- while (astAnnotationStream.hasNext()) {
- this.syncAddNestedAnnotation(astAnnotationStream.next());
- }
- }
-
- public ListIterable<T> getNestedAnnotations() {
- return new LiveCloneListIterable<T>(this.nestedAnnotations);
- }
-
- public int getNestedAnnotationsSize() {
- return this.nestedAnnotations.size();
- }
-
- public T nestedAnnotationAt(int index) {
- return this.nestedAnnotations.get(index);
- }
-
- public T addNestedAnnotation(int index) {
- // add a new annotation to the end of the list...
- int sourceIndex = this.getNestedAnnotationsSize();
- T nestedAnnotation = this.buildNestedAnnotation(sourceIndex);
- this.nestedAnnotations.add(sourceIndex, nestedAnnotation);
- nestedAnnotation.newAnnotation();
- // ...then move it to the specified index
- this.moveNestedAnnotation(index, sourceIndex);
- return nestedAnnotation;
- }
-
- public T moveNestedAnnotation(int targetIndex, int sourceIndex) {
- if (targetIndex != sourceIndex) {
- return this.moveNestedAnnotation_(targetIndex, sourceIndex);
- }
- return null;
- }
-
- public T removeNestedAnnotation(int index) {
- T nestedAnnotation = this.nestedAnnotations.remove(index);
- nestedAnnotation.removeAnnotation();
- this.syncAstAnnotationsAfterRemove(index);
- return nestedAnnotation;
- }
-
- private T moveNestedAnnotation_(int targetIndex, int sourceIndex) {
- T nestedAnnotation = CollectionTools.move(this.nestedAnnotations, targetIndex, sourceIndex).get(targetIndex);
- this.syncAstAnnotationsAfterMove(targetIndex, sourceIndex, nestedAnnotation);
- return nestedAnnotation;
- }
-
- /**
- * Return a list of the nested AST annotations.
- */
- private ArrayList<org.eclipse.jdt.core.dom.Annotation> getNestedAstAnnotations(org.eclipse.jdt.core.dom.Annotation astContainerAnnotation) {
- ArrayList<org.eclipse.jdt.core.dom.Annotation> result = new ArrayList<org.eclipse.jdt.core.dom.Annotation>();
- if (astContainerAnnotation == null || astContainerAnnotation.isMarkerAnnotation()) {
- // no nested annotations
- }
- else if (astContainerAnnotation.isSingleMemberAnnotation()) {
- if (this.getElementName().equals("value")) { //$NON-NLS-1$
- Expression ex = ((SingleMemberAnnotation) astContainerAnnotation).getValue();
- this.addAstAnnotationsTo(ex, result);
- } else {
- // no nested annotations
- }
- }
- else if (astContainerAnnotation.isNormalAnnotation()) {
- MemberValuePair pair = this.getMemberValuePair((NormalAnnotation) astContainerAnnotation);
- if (pair == null) {
- // no nested annotations
- } else {
- this.addAstAnnotationsTo(pair.getValue(), result);
- }
- }
- return result;
- }
-
- /**
- * Add whatever annotations are represented by the specified expression to
- * the specified list. Do not add null to the list for any non-annotation expression.
- */
- private void addAstAnnotationsTo(Expression expression, ArrayList<org.eclipse.jdt.core.dom.Annotation> astAnnotations) {
- if (expression == null) {
- //do not add null to the list, not sure how we would get here...
- }
- else if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- this.addAstAnnotationsTo((ArrayInitializer) expression, astAnnotations);
- }
- else {
- org.eclipse.jdt.core.dom.Annotation astAnnotation = this.getAstAnnotation_(expression);
- if (astAnnotation != null) {
- astAnnotations.add(astAnnotation);
- }
- }
- }
-
- private void addAstAnnotationsTo(ArrayInitializer arrayInitializer, ArrayList<org.eclipse.jdt.core.dom.Annotation> astAnnotations) {
- List<Expression> expressions = this.expressions(arrayInitializer);
- for (Expression expression : expressions) {
- org.eclipse.jdt.core.dom.Annotation astAnnotation = getAstAnnotation(expression);
- if (astAnnotation != null) {
- astAnnotations.add(astAnnotation);
- }
- }
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
- /**
- * If the specified expression is an annotation with the specified name, return it;
- * otherwise return null.
- */
- private org.eclipse.jdt.core.dom.Annotation getAstAnnotation(Expression expression) {
- // not sure how the expression could be null...
- return (expression == null) ? null : getAstAnnotation_(expression);
- }
-
- /**
- * pre-condition: expression is not null
- */
- private org.eclipse.jdt.core.dom.Annotation getAstAnnotation_(Expression expression) {
- switch (expression.getNodeType()) {
- case ASTNode.NORMAL_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.MARKER_ANNOTATION:
- org.eclipse.jdt.core.dom.Annotation astAnnotation = (org.eclipse.jdt.core.dom.Annotation) expression;
- if (this.getQualifiedName(astAnnotation).equals(this.getNestedAnnotationName())) {
- return astAnnotation;
- }
- return null;
- default:
- return null;
- }
- }
-
- private String getQualifiedName(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- ITypeBinding typeBinding = astAnnotation.resolveTypeBinding();
- if (typeBinding != null) {
- String resolvedName = typeBinding.getQualifiedName();
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- return astAnnotation.getTypeName().getFullyQualifiedName();
- }
-
- private MemberValuePair getMemberValuePair(NormalAnnotation annotation) {
- List<MemberValuePair> pairs = this.values(annotation);
- for (MemberValuePair pair : pairs) {
- if (pair.getName().getFullyQualifiedName().equals(this.getElementName())) {
- return pair;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
- /**
- * An annotation was moved within the specified annotation container from
- * the specified source index to the specified target index.
- * Synchronize the AST annotations with the resource model annotation container,
- * starting with the lower index to prevent overlap.
- */
- private void syncAstAnnotationsAfterMove(int targetIndex, int sourceIndex, T nestedAnnotation) {
- // move the Java annotation to the end of the list...
- nestedAnnotation.moveAnnotation(this.getNestedAnnotationsSize());
- // ...then shift the other AST annotations over one slot...
- if (sourceIndex < targetIndex) {
- for (int i = sourceIndex; i < targetIndex; i++) {
- this.nestedAnnotations.get(i).moveAnnotation(i);
- }
- } else {
- for (int i = sourceIndex; i > targetIndex; i-- ) {
- this.nestedAnnotations.get(i).moveAnnotation(i);
- }
- }
- // ...then move the AST annotation to the now empty slot at the target index
- nestedAnnotation.moveAnnotation(targetIndex);
- }
-
- /**
- * An annotation was removed from the specified annotation container at the
- * specified index.
- * Synchronize the AST annotations with the resource model annotation container,
- * starting at the specified index to prevent overlap.
- */
- private void syncAstAnnotationsAfterRemove(int index) {
- for (int i = index; i < this.getNestedAnnotationsSize(); i++) {
- // the indices are the same because the model annotations are
- // already in the proper locations - it's the AST annotations that
- // need to be moved to the matching location
- this.nestedAnnotations.get(i).moveAnnotation(i);
- }
- }
-
- protected void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.getNestedAnnotationsSize();
- T nestedAnnotation = this.buildNestedAnnotation(index);
- nestedAnnotation.initialize((CompilationUnit) astAnnotation.getRoot());
- this.nestedAnnotations.add(index, nestedAnnotation);
- this.fireItemAdded(index, nestedAnnotation);
- }
-
- protected void syncRemoveNestedAnnotations(int index) {
- List<T> subList = this.nestedAnnotations.subList(index, this.getNestedAnnotationsSize());
- List<T> removedItems = new ArrayList<T>(subList);
- subList.clear();
- this.fireItemsRemoved(index, removedItems);
- }
-
- @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/resource/java/source/SourcePackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java
deleted file mode 100644
index 59d44226df..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IPackageBinding;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTPackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-
-/**
- * @author Dmitry Geraskov
- * Source package-info.java
- *
- */
-public final class SourcePackage
- extends SourceAnnotatedElement<AnnotatedPackage>
- implements JavaResourcePackage {
-
- private String name;
-
- /**
- * construct package info
- */
- public static JavaResourcePackage newInstance(
- JavaResourceCompilationUnit parent,
- PackageDeclaration declaringPackage,
- CompilationUnit astRoot) {
- AnnotatedPackage pack = new JDTPackage(
- declaringPackage,
- parent.getCompilationUnit(),
- parent.getModifySharedDocumentCommandExecutor(),
- parent.getAnnotationEditFormatter());
- JavaResourcePackage jrpp = new SourcePackage(parent, pack);
- jrpp.initialize(astRoot);
- return jrpp;
- }
-
- private SourcePackage(
- JavaResourceCompilationUnit parent,
- AnnotatedPackage pack){
- super(parent, pack);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.name = this.buildName(astRoot);
- }
-
-
- // ********** JavaResourcePackageInfo implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- private void syncName(String astName) {
- if (valuesAreDifferent(astName, this.name)){
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
- }
-
- private String buildName(CompilationUnit astRoot) {
- IPackageBinding binding = this.annotatedElement.getBinding(astRoot);
- return (binding == null) ? null : binding.getName();
- }
-
-
- // ********** Java changes **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncName(this.buildName(astRoot));
- }
-
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
deleted file mode 100644
index 19a02b00cb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.AnnotationProvider;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-
-/**
- * @author Dmitry Geraskov
- * Source package-info.java
- *
- */
-public final class SourcePackageInfoCompilationUnit
- extends SourceCompilationUnit
- implements JavaResourcePackageInfoCompilationUnit {
-
- private JavaResourcePackage package_;
-
- public SourcePackageInfoCompilationUnit(
- ICompilationUnit compilationUnit,
- AnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the JPA compilation unit is the root of its sub-tree
- this.package_ = this.buildPackage();
- }
-
-
- private JavaResourcePackage buildPackage() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPackage(astRoot);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public Iterable<JavaResourceAbstractType> getTypes() {
- return EmptyIterable.instance();
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncPackage(astRoot);
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public void resolveTypes() {
- //no-op
- }
-
- // ********** package-info **********
-
- public JavaResourcePackage getPackage() {
- return this.package_;
- }
-
- private JavaResourcePackage buildPackage(CompilationUnit astRoot) {
- return this.buildPackage(astRoot, this.getPackageDeclaration(astRoot));
- }
-
- private void syncPackage(CompilationUnit astRoot) {
- PackageDeclaration pd = this.getPackageDeclaration(astRoot);
- if (pd == null) {
- this.syncPackage_(null);
- } else {
- if (this.package_ == null) {
- this.syncPackage_(this.buildPackage(astRoot, pd));
- } else {
- this.package_.synchronizeWith(astRoot);
- }
- }
- }
-
- private PackageDeclaration getPackageDeclaration(CompilationUnit astRoot) {
- return astRoot.getPackage();
- }
-
- private void syncPackage_(JavaResourcePackage astPackage) {
- JavaResourcePackage old = this.package_;
- this.package_ = astPackage;
- this.firePropertyChanged(PACKAGE, old, astPackage);
- }
-
- private JavaResourcePackage buildPackage(CompilationUnit astRoot, PackageDeclaration packageDeclaration) {
- return SourcePackage.newInstance(this, packageDeclaration, astRoot);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java
deleted file mode 100644
index 5d35c52984..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.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.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTType;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TreeIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
-
-/**
- * Java source type
- */
-final class SourceType
- extends SourceAbstractType<Type>
- implements JavaResourceType
-{
-
- private String superclassQualifiedName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private boolean hasNoArgConstructor;
-
- private final Vector<JavaResourceType> types;
-
- private final Vector<JavaResourceEnum> enums;
-
- private final Vector<JavaResourceField> fields;
-
- private final Vector<JavaResourceMethod> methods;
-
-
- // ********** construction/initialization **********
-
- /**
- * build top-level type
- */
- static JavaResourceType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- TypeDeclaration typeDeclaration,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- typeDeclaration,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceType jrpt = new SourceType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- /**
- * build nested type
- */
- private static JavaResourceType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- Type declaringType,
- TypeDeclaration typeDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- declaringType,
- typeDeclaration,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourceType jrpt = new SourceType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- private SourceType(JavaResourceCompilationUnit javaResourceCompilationUnit, Type type) {
- super(javaResourceCompilationUnit, type);
- this.types = new Vector<JavaResourceType>();
- this.enums = new Vector<JavaResourceEnum>();
- this.fields = new Vector<JavaResourceField>();
- this.methods = new Vector<JavaResourceMethod>();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.superclassQualifiedName = this.buildSuperclassQualifiedName(binding);
- this.abstract_ = this.buildAbstract(binding);
- this.hasNoArgConstructor = this.buildHasNoArgConstructor(binding);
- this.initializeTypes(astRoot);
- this.initializeEnums(astRoot);
- this.initializeFields(astRoot);
- this.initializeMethods(astRoot);
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(binding));
- this.syncAbstract(this.buildAbstract(binding));
- this.syncHasNoArgConstructor(this.buildHasNoArgConstructor(binding));
- this.syncTypes(astRoot);
- this.syncEnums(astRoot);
- this.syncFields(astRoot);
- this.syncMethods(astRoot);
- }
-
-
- // ********** SourceAnnotatedElement implementation **********
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(this.annotatedElement.getBinding(astRoot)));
-
- for (JavaResourceField field : this.getFields()) {
- field.resolveTypes(astRoot);
- }
-
- // a new type can trigger a method parameter type to be a resolved,
- // fully-qualified name, so we need to rebuild our list of methods:
- // "setFoo(Foo)" is not the same as "setFoo(com.bar.Foo)"
- // and, vice-versa, a removed type can "unresolve" a parameter type
- this.syncMethods(astRoot);
-
- for (JavaResourceMethod method : this.getMethods()) {
- method.resolveTypes(astRoot);
- }
- for (JavaResourceType type : this.getTypes()) {
- type.resolveTypes(astRoot);
- }
- for (JavaResourceEnum enum_ : this.getEnums()) {
- enum_.resolveTypes(astRoot);
- }
- }
-
-
- // ******** JavaResourceType implementation ********
-
- public Kind getKind() {
- return Kind.TYPE;
- }
-
- // ***** superclass qualified name
- public String getSuperclassQualifiedName() {
- return this.superclassQualifiedName;
- }
-
- private void syncSuperclassQualifiedName(String astSuperclassQualifiedName) {
- String old = this.superclassQualifiedName;
- this.superclassQualifiedName = astSuperclassQualifiedName;
- this.firePropertyChanged(SUPERCLASS_QUALIFIED_NAME_PROPERTY, old, astSuperclassQualifiedName);
- }
-
- private String buildSuperclassQualifiedName(ITypeBinding binding) {
- if (binding == null) {
- return null;
- }
- ITypeBinding superclass = binding.getSuperclass();
- return (superclass == null) ? null : superclass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** abstract
- public boolean isAbstract() {
- return this.abstract_;
- }
-
- private void syncAbstract(boolean astAbstract) {
- boolean old = this.abstract_;
- this.abstract_ = astAbstract;
- this.firePropertyChanged(ABSTRACT_PROPERTY, old, astAbstract);
- }
-
- private boolean buildAbstract(ITypeBinding binding) {
- return (binding == null) ? false : Modifier.isAbstract(binding.getModifiers());
- }
-
- // ***** no-arg constructor
- public boolean hasNoArgConstructor() {
- return this.hasNoArgConstructor;
- }
-
- private void syncHasNoArgConstructor(boolean hasNoArgConstructor) {
- boolean old = this.hasNoArgConstructor;
- this.hasNoArgConstructor = hasNoArgConstructor;
- this.firePropertyChanged(NO_ARG_CONSTRUCTOR_PROPERTY, old, hasNoArgConstructor);
- }
-
- private boolean buildHasNoArgConstructor(ITypeBinding binding) {
- return (binding == null) ? false : typeHasNoArgConstructor(binding);
- }
-
- protected static boolean typeHasNoArgConstructor(ITypeBinding binding) {
- return findNoArgConstructor(binding) != null;
- }
-
- protected static IMethodBinding findNoArgConstructor(ITypeBinding binding) {
- for (IMethodBinding method : binding.getDeclaredMethods()) {
- if (method.isConstructor()) {
- if (method.getParameterTypes().length == 0) {
- return method;
- }
- }
- }
- return null;
- }
-
- // ********** types **********
-
- public Iterable<JavaResourceType> getTypes() {
- return new LiveCloneIterable<JavaResourceType>(this.types); // read-only
- }
-
- public Iterable<JavaResourceType> getAllTypes() {
- return new TreeIterable<JavaResourceType>(this) {
- @Override
- protected Iterator<? extends JavaResourceType> children(JavaResourceType type) {
- return type.getTypes().iterator();
- }
- };
- }
-
- private JavaResourceType getType(String typeName, int occurrence) {
- for (JavaResourceType type : this.getTypes()) {
- if (type.isFor(typeName, occurrence)) {
- return type;
- }
- }
- return null;
- }
-
- private void addType(JavaResourceType type) {
- this.addItemToCollection(type, this.types, TYPES_COLLECTION);
- }
-
- private void removeTypes(Collection<JavaResourceType> remove) {
- this.removeItemsFromCollection(remove, this.types, TYPES_COLLECTION);
- }
-
- private void initializeTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- for (TypeDeclaration td : typeDeclarations) {
- String tdName = td.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
- this.types.add(this.buildType(td, occurrence, astRoot));
- }
- }
-
- private void syncTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- HashSet<JavaResourceType> typesToRemove = new HashSet<JavaResourceType>(this.types);
- for (TypeDeclaration typeDeclaration : typeDeclarations) {
- String tdName = typeDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
-
- JavaResourceType type = this.getType(tdName, occurrence);
- if (type == null) {
- this.addType(this.buildType(typeDeclaration, occurrence, astRoot));
- } else {
- typesToRemove.remove(type);
- type.synchronizeWith(astRoot);
- }
- }
- this.removeTypes(typesToRemove);
- }
-
- private JavaResourceType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) {
- return newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedTypeDeclaration, occurrence, astRoot);
- }
-
-
- // ********** enums **********
-
- public Iterable<JavaResourceEnum> getEnums() {
- return new LiveCloneIterable<JavaResourceEnum>(this.enums); // read-only
- }
-
- public Iterable<JavaResourceEnum> getAllEnums() {
- return this.getEnums();
- }
-
- private JavaResourceEnum getEnum(String enumName, int occurrence) {
- for (JavaResourceEnum enum_ : this.getEnums()) {
- if (enum_.isFor(enumName, occurrence)) {
- return enum_;
- }
- }
- return null;
- }
-
- private void addEnum(JavaResourceEnum enum_) {
- this.addItemToCollection(enum_, this.enums, ENUMS_COLLECTION);
- }
-
- private void removeEnums(Collection<JavaResourceEnum> remove) {
- this.removeItemsFromCollection(remove, this.enums, ENUMS_COLLECTION);
- }
-
- private void initializeEnums(CompilationUnit astRoot) {
- EnumDeclaration[] enumDeclarations = this.annotatedElement.getEnums(astRoot);
- CounterMap counters = new CounterMap(enumDeclarations.length);
- for (EnumDeclaration ed : enumDeclarations) {
- String tdName = ed.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
- this.enums.add(this.buildEnum(ed, occurrence, astRoot));
- }
- }
-
- private void syncEnums(CompilationUnit astRoot) {
- EnumDeclaration[] enumDeclarations = this.annotatedElement.getEnums(astRoot);
- CounterMap counters = new CounterMap(enumDeclarations.length);
- HashSet<JavaResourceEnum> enumsToRemove = new HashSet<JavaResourceEnum>(this.enums);
- for (EnumDeclaration enumDeclaration : enumDeclarations) {
- String tdName = enumDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
-
- JavaResourceEnum enum_ = this.getEnum(tdName, occurrence);
- if (enum_ == null) {
- this.addEnum(this.buildEnum(enumDeclaration, occurrence, astRoot));
- } else {
- enumsToRemove.remove(enum_);
- enum_.synchronizeWith(astRoot);
- }
- }
- this.removeEnums(enumsToRemove);
- }
-
- private JavaResourceEnum buildEnum(EnumDeclaration nestedEnumDeclaration, int occurrence, CompilationUnit astRoot) {
- return SourceEnum.newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedEnumDeclaration, occurrence, astRoot);
- }
-
-
- // ********** fields **********
-
- public Iterable<JavaResourceField> getFields() {
- return new LiveCloneIterable<JavaResourceField>(this.fields);
- }
-
- private void addField(JavaResourceField field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourceField getField(String fieldName, int occurrence) {
- for (JavaResourceField field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourceField> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private void initializeFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
- this.fields.add(this.buildField(fieldName, occurrence, astRoot));
- }
- }
- }
-
- private void syncFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- HashSet<JavaResourceField> fieldsToRemove = new HashSet<JavaResourceField>(this.fields);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
-
- JavaResourceField field = this.getField(fieldName, occurrence);
- if (field == null) {
- this.addField(this.buildField(fieldName, occurrence, astRoot));
- } else {
- fieldsToRemove.remove(field);
- field.synchronizeWith(astRoot);
- }
- }
- }
- this.removeFields(fieldsToRemove);
- }
-
- private JavaResourceField buildField(String fieldName, int occurrence, CompilationUnit astRoot) {
- return SourceField.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-
- // ********** methods **********
-
- public Iterable<JavaResourceMethod> getMethods() {
- return new LiveCloneIterable<JavaResourceMethod>(this.methods);
- }
-
- private JavaResourceMethod getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourceMethod method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourceMethod method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourceMethod> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private void initializeMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
- this.methods.add(this.buildMethod(signature, occurrence, astRoot));
- }
- }
-
- private void syncMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- HashSet<JavaResourceMethod> methodsToRemove = new HashSet<JavaResourceMethod>(this.methods);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
-
- JavaResourceMethod method = this.getMethod(signature, occurrence);
- if (method == null) {
- this.addMethod(this.buildMethod(signature, occurrence, astRoot));
- } else {
- methodsToRemove.remove(method);
- method.synchronizeWith(astRoot);
- }
- }
- this.removeMethods(methodsToRemove);
- }
-
- private JavaResourceMethod buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) {
- return SourceMethod.newInstance(this, this.annotatedElement, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java
deleted file mode 100644
index ee4d67c56f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.AnnotationProvider;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-
-/**
- * Java compilation unit (source file)
- * non package-info.java file
- */
-public final class SourceTypeCompilationUnit
- extends SourceCompilationUnit
-{
-
- /**
- * The primary type of the AST compilation unit. We are not going to handle
- * multiple types defined in a single compilation unit. Entities must have
- * a public/protected no-arg constructor, and there is no way to access
- * the constructor in a package class (which is what all top-level,
- * non-primary classes must be).
- */
- private JavaResourceAbstractType type;
-
-
- // ********** construction **********
-
- public SourceTypeCompilationUnit(
- ICompilationUnit compilationUnit,
- AnnotationProvider annotationProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the compilation unit is the root of its sub-tree
- this.type = this.buildType();
- }
-
- private JavaResourceAbstractType buildType() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPersistentType(astRoot);
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncType(astRoot);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- /**
- * NB: return *all* the types since we build them all
- */
- public Iterable<JavaResourceAbstractType> getTypes() {
- return (this.type == null) ?
- EmptyIterable.<JavaResourceAbstractType>instance() :
- new CompositeIterable<JavaResourceAbstractType>(this.type.getAllTypes(), this.type.getAllEnums());
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public void resolveTypes() {
- if (this.type != null) {
- this.type.resolveTypes(this.buildASTRoot());
- }
- }
-
-
- // ********** persistent type **********
-
- private JavaResourceAbstractType buildPersistentType(CompilationUnit astRoot) {
- AbstractTypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
- return (td == null) ? null : this.buildType(astRoot, td);
- }
-
-
- private void syncType(CompilationUnit astRoot) {
- AbstractTypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
- if (td == null) {
- this.syncType_(null);
- } else {
- if (this.type == null) {
- this.syncType_(this.buildType(astRoot, td));
- } else {
- this.type.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncType_(JavaResourceAbstractType astType) {
- JavaResourceAbstractType old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPES_COLLECTION, old, astType);
- }
-
-
- // ********** internal **********
-
- private JavaResourceAbstractType buildType(CompilationUnit astRoot, AbstractTypeDeclaration typeDeclaration) {
- if (typeDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION) {
- return SourceType.newInstance(this, (TypeDeclaration) typeDeclaration, astRoot);
- }
- else if (typeDeclaration.getNodeType() == ASTNode.ENUM_DECLARATION) {
- return SourceEnum.newInstance(this, (EnumDeclaration) typeDeclaration, astRoot);
- }
- throw new IllegalArgumentException();
- }
-
- /**
- * i.e. the type with the same name as the compilation unit;
- * return the first class or interface (ignore annotations and enums) with
- * the same name as the compilation unit (file);
- * NB: this type could be in error if there is an annotation or enum
- * with the same name preceding it in the compilation unit
- *
- * Return null if the parser did not resolve the type declaration's binding.
- * This can occur if the project JRE is removed (bug 225332).
- */
- private AbstractTypeDeclaration getPrimaryTypeDeclaration(CompilationUnit astRoot) {
- String primaryTypeName = this.getPrimaryTypeName();
- for (AbstractTypeDeclaration atd : this.types(astRoot)) {
- if (this.nodeIsPrimaryTypeDeclaration(atd, primaryTypeName)) {
- return (atd.resolveBinding() == null) ? null : atd;
- }
- }
- return null;
- }
-
- private boolean nodeIsPrimaryTypeDeclaration(AbstractTypeDeclaration atd, String primaryTypeName) {
- return (atd.getNodeType() == ASTNode.TYPE_DECLARATION || atd.getNodeType() == ASTNode.ENUM_DECLARATION) &&
- (atd.getName().getFullyQualifiedName().equals(primaryTypeName));
- }
-
- private String getPrimaryTypeName() {
- return this.getCompilationUnitName();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-}
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 63426d92f1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.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.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.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.JavaResourceAnnotatedElement;
-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<AnnotatedElement>
- implements XmlAccessorOrderAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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 ANNOTATION_NAME;
- }
-
- 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 bbc7fd08ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.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.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.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.JavaResourceAnnotatedElement;
-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<AnnotatedElement>
- implements XmlAccessorTypeAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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 ANNOTATION_NAME;
- }
-
- 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 b8bb3a477d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class SourceXmlAnyAttributeAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlAnyAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlAnyAttributeAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 18fe641193..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,172 +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.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.utility.TextRange;
-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.Attribute;
-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.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class SourceXmlAnyElementAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlAnyElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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(JavaResourceMember parent, Attribute attribute) {
- this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAnyElementAnnotation(JavaResourceMember parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, attribute, 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 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 ANNOTATION_NAME;
- }
-
- 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 c342b209bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class SourceXmlAttachmentRefAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlAttachmentRefAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlAttachmentRefAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 26391d1a39..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,185 +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.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.utility.TextRange;
-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.Attribute;
-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.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class SourceXmlAttributeAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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(JavaResourceMember parent, Attribute attribute) {
- this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAttributeAnnotation(JavaResourceMember parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, attribute, 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 ANNOTATION_NAME;
- }
-
- 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);
- }
-
- // ***** 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);
- }
-
- // ***** 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 9052b33bf5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
+++ /dev/null
@@ -1,362 +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.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.utility.TextRange;
-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.Attribute;
-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.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class SourceXmlElementAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlElementAnnotation
-{
- private static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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;
-
-
- // ********** constructors **********
- public static SourceXmlElementAnnotation buildSourceXmlElementAnnotation(JavaResourceMember parent, Attribute attribute) {
- return new SourceXmlElementAnnotation(
- parent,
- attribute,
- DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementAnnotation buildNestedSourceXmlElementAnnotation(JavaResourceNode parent, Attribute attribute, IndexedDeclarationAnnotationAdapter idaa) {
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(attribute, idaa);
- return new SourceXmlElementAnnotation(parent, attribute, idaa, annotationAdapter);
- }
-
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, attribute, 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 SourceXmlElementAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- this(parent, attribute, daa, new ElementAnnotationAdapter(attribute, daa));
- }
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, Attribute attribute, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, attribute, idaa, new ElementIndexedAnnotationAdapter(attribute, idaa));
- }
-
- 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 ANNOTATION_NAME;
- }
-
- 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);
- }
-
- // ***** 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);
- }
-
- // ***** 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
- */
- 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 b50d5e1fcc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,313 +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.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.utility.TextRange;
-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.MethodAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class SourceXmlElementDeclAnnotation
- extends SourceAnnotation<MethodAttribute>
- implements XmlElementDeclAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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 static final DeclarationAnnotationElementAdapter<String> DEFAULT_VALUE_ADAPTER = buildDefaultValueAdapter();
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
- private static final DeclarationAnnotationElementAdapter<String> SCOPE_ADAPTER = buildScopeAdapter();
- private final AnnotationElementAdapter<String> scopeAdapter;
- private String scope;
- private String fullyQualifiedScopeClassName;
-
- private static final DeclarationAnnotationElementAdapter<String> SUBSTITUTION_HEAD_NAME_ADAPTER = buildSubstitutionHeadNameAdapter();
- private final AnnotationElementAdapter<String> substitutionHeadNameAdapter;
- private String substitutionHeadName;
-
- private static final DeclarationAnnotationElementAdapter<String> SUBSTITUTION_HEAD_NAMESPACE_ADAPTER = buildSubstitutionHeadNamespaceAdapter();
- private final AnnotationElementAdapter<String> substitutionHeadNamespaceAdapter;
- private String substitutionHeadNamespace;
-
-
- // ********** constructors **********
-
- public SourceXmlElementDeclAnnotation(JavaResourceMethod parent, MethodAttribute method) {
- super(parent, method, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(method, DECLARATION_ANNOTATION_ADAPTER));
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- this.defaultValueAdapter = this.buildAnnotationElementAdapter(DEFAULT_VALUE_ADAPTER);
- this.scopeAdapter = this.buildAnnotationElementAdapter(SCOPE_ADAPTER);
- this.substitutionHeadNameAdapter = this.buildAnnotationElementAdapter(SUBSTITUTION_HEAD_NAME_ADAPTER);
- this.substitutionHeadNamespaceAdapter = this.buildAnnotationElementAdapter(SUBSTITUTION_HEAD_NAMESPACE_ADAPTER);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.defaultValue = this.buildDefaultValue(astRoot);
- this.scope = this.buildScope(astRoot);
- this.fullyQualifiedScopeClassName = this.buildFullyQualifiedScopeClassName(astRoot);
- this.substitutionHeadName = this.buildSubstitutionHeadName(astRoot);
- this.substitutionHeadNamespace = this.buildSubstitutionHeadNamespace(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncDefaultValue(this.buildDefaultValue(astRoot));
- this.syncScope(this.buildScope(astRoot));
- this.syncFullyQualifiedScopeClassName(this.buildFullyQualifiedScopeClassName(astRoot));
- this.syncSubstitutionHeadName(this.buildSubstitutionHeadName(astRoot));
- this.syncSubstitutionHeadNamespace(this.buildSubstitutionHeadNamespace(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementDeclAnnotation 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);
- }
-
- // ***** 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);
- }
-
- // ***** 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(DEFAULT_VALUE_ADAPTER, astRoot);
- }
-
- // ***** scope
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- if (this.attributeValueHasChanged(this.scope, scope)) {
- this.scope = scope;
- this.scopeAdapter.setValue(scope);
- }
- }
-
- private void syncScope(String astScope) {
- String old = this.scope;
- this.scope = astScope;
- this.firePropertyChanged(SCOPE_PROPERTY, old, astScope);
- }
-
- private String buildScope(CompilationUnit astRoot) {
- return this.scopeAdapter.getValue(astRoot);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SCOPE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified scope class name
- public String getFullyQualifiedScopeClassName() {
- return this.fullyQualifiedScopeClassName;
- }
-
- private void syncFullyQualifiedScopeClassName(String name) {
- String old = this.fullyQualifiedScopeClassName;
- this.fullyQualifiedScopeClassName = name;
- this.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));
- }
-
- // ***** substitutionHeadName
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- if (this.attributeValueHasChanged(this.substitutionHeadName, substitutionHeadName)) {
- this.substitutionHeadName = substitutionHeadName;
- this.substitutionHeadNameAdapter.setValue(substitutionHeadName);
- }
- }
-
- private void syncSubstitutionHeadName(String astSubstitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = astSubstitutionHeadName;
- this.firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, astSubstitutionHeadName);
- }
-
- private String buildSubstitutionHeadName(CompilationUnit astRoot) {
- return this.substitutionHeadNameAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SUBSTITUTION_HEAD_NAME_ADAPTER, astRoot);
- }
-
- // ***** substitutionHeadNamespace
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- if (this.attributeValueHasChanged(this.substitutionHeadNamespace, substitutionHeadNamespace)) {
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- this.substitutionHeadNamespaceAdapter.setValue(substitutionHeadNamespace);
- }
- }
-
- private void syncSubstitutionHeadNamespace(String astSubstitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = astSubstitutionHeadNamespace;
- this.firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, astSubstitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace(CompilationUnit astRoot) {
- return this.substitutionHeadNamespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SUBSTITUTION_HEAD_NAMESPACE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildDefaultValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildScopeAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SCOPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- private 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/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 33971cf6d2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,253 +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.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.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.Attribute;
-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.JavaResourceField;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class SourceXmlElementRefAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlElementRefAnnotation
-{
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public static final SimpleDeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REFS);
-
- 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<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
-
- // ********** constructors **********
- public static SourceXmlElementRefAnnotation buildSourceXmlElementRefAnnotation(JavaResourceField parent, Attribute attribute, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildXmlElementRefDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlElementRefAnnotationAdapter(attribute, idaa);
- return new SourceXmlElementRefAnnotation(
- parent,
- attribute,
- idaa,
- iaa);
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceField parent,
- Attribute attribute,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, attribute, 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.typeDeclarationAdapter = this.buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_REF__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(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);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(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.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);
- }
-
- // ***** 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);
- }
-
- // ***** 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
- */
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlElementRefAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlElementRefDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_ELEMENT_REF);
- return idaa;
- }
-
-}
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 79bfc80693..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,223 +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.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.utility.TextRange;
-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.Attribute;
-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.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class SourceXmlElementWrapperAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlElementWrapperAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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(JavaResourceMember parent, Attribute attribute) {
- this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlElementWrapperAnnotation(JavaResourceMember parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, attribute, 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 ANNOTATION_NAME;
- }
-
- 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);
- }
-
- // ***** 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);
- }
-
- // ***** 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 a938c23116..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.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.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.utility.jdt.Attribute;
-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.JavaResourceAttribute;
-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<Attribute>
- implements XmlElementsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- private final XmlElementsAnnotationContainer xmlElementsContainer = new XmlElementsAnnotationContainer();
-
- public SourceXmlElementsAnnotation(JavaResourceAttribute parent, Attribute attribute) {
- this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementsAnnotation(JavaResourceAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementsContainer.initialize(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.nestedAnnotationAt(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 getAnnotationsPropertyName() {
- 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 797de4e8e4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
+++ /dev/null
@@ -1,125 +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.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.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class SourceXmlEnumAnnotation
- extends SourceAnnotation<AbstractType>
- implements XmlEnumAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- private String fullyQualifiedValueClassName;
-
- public SourceXmlEnumAnnotation(JavaResourceAbstractType parent, AbstractType type) {
- super(parent, type, 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 ANNOTATION_NAME;
- }
-
- 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 5d3bab34a1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.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.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.utility.TextRange;
-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.EnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class SourceXmlEnumValueAnnotation
- extends SourceAnnotation<EnumConstant>
- implements XmlEnumValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlEnumValueAnnotation(JavaResourceEnumConstant parent, EnumConstant enumConstant) {
- super(parent, enumConstant, 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 ANNOTATION_NAME;
- }
-
- 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);
- }
-
-
- //*********** 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 8968a82695..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class SourceXmlIDAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlIDAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlIDAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 d2f96423b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class SourceXmlIDREFAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlIDREFAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlIDREFAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 e017397b69..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class SourceXmlInlineBinaryDataAnnotation
- extends SourceAnnotation<Member>
- implements XmlInlineBinaryDataAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlInlineBinaryDataAnnotation(JavaResourceMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 8409f6df44..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,246 +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.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.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.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class SourceXmlJavaTypeAdapterAnnotation
- extends SourceAnnotation<AnnotatedElement>
- implements XmlJavaTypeAdapterAnnotation
-{
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public static final SimpleDeclarationAnnotationAdapter 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;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
- /*
- * We want these events fired when the fq classes change by themselves, not as a result
- * of the non-fq classes changing.
- */
- private boolean suppressFQClassesEventNotification = 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 element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, 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 ANNOTATION_NAME;
- }
-
- 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.suppressFQClassesEventNotification = 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.suppressFQClassesEventNotification = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.suppressFQClassesEventNotification |= 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.suppressFQClassesEventNotification) {
- 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.suppressFQClassesEventNotification = true;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.suppressFQClassesEventNotification |= 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.suppressFQClassesEventNotification) {
- 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
- */
- 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 1d66e39a9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class SourceXmlListAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlListAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlListAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 6465642f3d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,98 +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.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.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-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.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class SourceXmlMimeTypeAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlMimeTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlMimeTypeAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, 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 ANNOTATION_NAME;
- }
-
- 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 06db802a49..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class SourceXmlMixedAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlMixedAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlMixedAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 945b367265..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
+++ /dev/null
@@ -1,151 +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.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.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-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.JavaResourceNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-
-public class SourceXmlNsAnnotation
- extends SourceAnnotation<AnnotatedPackage>
- 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, AnnotatedPackage pack, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, pack, idaa, new ElementIndexedAnnotationAdapter(pack, 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 ANNOTATION_NAME;
- }
-
- 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 this.getElementTextRange(this.namespaceURIDeclarationAdapter, 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 this.getElementTextRange(this.prefixDeclarationAdapter, astRoot);
- }
-
-
- // **************** NestableAnnotation impl *******************************
-
- 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 dea96474f9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class SourceXmlRegistryAnnotation
- extends SourceAnnotation<AbstractType>
- implements XmlRegistryAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlRegistryAnnotation(JavaResourceAbstractType parent, AbstractType type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 d9b4f23898..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-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<AbstractType>
- implements XmlRootElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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(JavaResourceAbstractType parent, AbstractType type) {
- super(parent, type, 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 ANNOTATION_NAME;
- }
-
- 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 76df750769..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,303 +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.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.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedPackage;
-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.JavaResourcePackage;
-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<AnnotatedPackage>
- implements XmlSchemaAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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(JavaResourcePackage parent, AnnotatedPackage pack) {
- this(parent, pack, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlSchemaAnnotation(JavaResourcePackage parent, AnnotatedPackage pack, DeclarationAnnotationAdapter daa) {
- super(parent, pack, 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 ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.attributeFormDefault = buildAttributeFormDefault(astRoot);
- this.elementFormDefault = buildElementFormDefault(astRoot);
- this.location = buildLocation(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.xmlnsContainer.initialize(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.nestedAnnotationAt(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 getAnnotationsPropertyName() {
- 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 4fdd5507ab..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,272 +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.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.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.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchemaType
- */
-public class SourceXmlSchemaTypeAnnotation
- extends SourceAnnotation<AnnotatedElement>
- implements XmlSchemaTypeAnnotation {
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public static final SimpleDeclarationAnnotationAdapter 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 ANNOTATION_NAME;
- }
-
- 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
- */
- 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 c79dda09bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,168 +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.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.utility.jdt.AbstractType;
-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.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class SourceXmlSeeAlsoAnnotation
- extends SourceAnnotation<AbstractType>
- implements XmlSeeAlsoAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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(JavaResourceAbstractType parent, AbstractType type) {
- super(parent, type, 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 ANNOTATION_NAME;
- }
-
- 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 d4a89c124b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class SourceXmlTransientAnnotation
- extends SourceAnnotation<Member>
- implements XmlTransientAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlTransientAnnotation(JavaResourceMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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 5da847ba3a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
+++ /dev/null
@@ -1,322 +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.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AbstractType;
-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.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType;
-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<AbstractType>
- implements XmlTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- 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 DeclarationAnnotationElementAdapter<String[]> propOrderDeclarationAdapter;
- private final AnnotationElementAdapter<String[]> propOrderAdapter;
- private final Vector<String> propOrder = new Vector<String>();
-
- public SourceXmlTypeAnnotation(JavaResourceAbstractType parent, AbstractType type) {
- super(parent, type, 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 DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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);
- }
-
-
- //*********** 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 72621e49b0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.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.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class SourceXmlValueAnnotation
- extends SourceAnnotation<Attribute>
- implements XmlValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceXmlValueAnnotation(JavaResourceMember parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- 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/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 b4c447f0a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.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.validation;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-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, Object targetObject) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, String[] parms, Object targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, Object targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(
- int defaultSeverity, String messageId, String[] parms, Object targetObject, TextRange textRange) {
-
- //determine whether default severity should be overridden
- int severity = defaultSeverity;
-
- // TODO - user override of errors/warnings
-// int severityPreference = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
-// if (severityPreference != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
-// severity = severityPreference;
-// }
-
- IMessage message = new Message(JaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
-
- if (textRange == null) {
- //log an exception and then continue without setting location information
- //At least the user will still get the validation message and will
- //be able to see other validation messages with valid textRanges
- JptJaxbCorePlugin.log(new IllegalArgumentException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
- }
- else {
- message.setLineNo(textRange.getLineNumber());
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- }
- return message;
- }
-
-
- private DefaultValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-}
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 ee5ac49471..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
+++ /dev/null
@@ -1,45 +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";
-
- // 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";
-
- // validation on type
- String XML_TYPE_UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = "XML_TYPE_UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE";
- String XML_TYPE_UNRESOLVED_SCHEMA_TYPE = "XML_TYPE_UNRESOLVED_SCHEMA_TYPE";
-
- String XML_ROOT_ELEMENT_UNRESOLVED_SCHEMA_ELEMENT = "XML_ROOT_ELEMENT_UNRESOLVED_SCHEMA_ELEMENT";
- String XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = "XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE";
-
- // validation on attribute mapping
- 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_LIST_DEFINED_ON_NON_ARRAY_NON_COLLECTION = "XML_LIST_DEFINED_ON_NON_ARRAY_NON_COLLECTION";
- String MULTIPLE_XML_ANY_ATTRIBUTE_MAPPINGS_DEFINED = "MULTIPLE_XML_ANY_ATTRIBUTE_MAPPINGS_DEFINED";
- String MULTIPLE_XML_ANY_ELEMENT_MAPPINGS_DEFINED = "MULTIPLE_XML_ANY_ELEMENT_MAPPINGS_DEFINED";
- String MULTIPLE_XML_VALUE_MAPPINGS_DEFINED = "MULTIPLE_XML_VALUE_MAPPINGS_DEFINED";
- String XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = "XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED";
- String XML_ANY_ATTRIBUTE_MAPPING_DEFINED_ON_NON_MAP = "XML_ANY_ATTRIBUTE_MAPPING_DEFINED_ON_NON_MAP";
- String XML_ID_DEFINED_ON_NON_STRING = "XML_ID_DEFINED_ON_NON_STRING";
- String MULTIPLE_XML_IDS_DEFINED = "MULTIPLE_XML_IDS_DEFINED";
- String XML_IDREF_TYPE_DOES_NOT_CONTAIN_XML_ID = "XML_IDREF_TYPE_DOES_NOT_CONTAIN_XML_ID";
-}
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 e743b5e569..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.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.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.common.core.IResourcePart;
-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) {
- validate(reporter, project(context));
- }
-
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
-
- // **************** AbstractValidator impl *********************************
-
- @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 conv. *****************************************
- private void clearMarkers(IProject project) {
- try {
- clearMarkers_(project);
- }
- catch (CoreException ce) {
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- 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.getValidationMessages(reporter, project)) {
- // check to see if the message should be ignored based on preferences
- // TODO JAXB validation preferences
-// if (!JpaValidationPreferences.isProblemIgnored(project, message.getId())){
- reporter.addMessage(this, adjustMessage(message));
-// }
-
- }
- }
-
- private IProject project(IValidationContext context) {
- return ((IProjectValidationContext) context).getProject();
- }
-
- private Iterable<IMessage> getValidationMessages(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));
- }
-
- private IMessage adjustMessage(IMessage message) {
- IAdaptable targetObject = (IAdaptable) message.getTargetObject();
- IResource targetResource = ((IResourcePart) targetObject.getAdapter(IResourcePart.class)).getResource();
- message.setTargetObject(targetResource);
- if (message.getLineNumber() == IMessage.LINENO_UNSET) {
- message.setAttribute(IMarker.LOCATION, " ");
- }
- return message;
- }
-}
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 99e042b319..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
+++ /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
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.jaxb.core.AnnotationProvider;
-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();
-
- // ********** 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 4f98d49401..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.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.platform;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-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;
-import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotationDefinition;
-
-/**
- * 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();
-
- 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/Annotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/Annotation.java
deleted file mode 100644
index af2a73bee3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/Annotation.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.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Common Java resource annotation behavior
- *
- * 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 Annotation
- extends JavaResourceNode
-{
- /**
- * Return the annotation's fully qualified name, as opposed to the value of
- * the annotation's 'name' element. For example:
- * @com.foo.Bar(name="Thomas")
- * #getAnnotationName() will return "com.foo.Bar".
- * In typical subclasses, #getName() would return "Thomas".
- * @see JAXB
- */
- String getAnnotationName();
-
- /**
- * Return the corresponding JDT DOM annotation from the specified
- * AST compilation unit.
- */
- org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot);
-
- /**
- * Create and add the corresponding Java annotation to the JDT DOM.
- */
- void newAnnotation();
-
- /**
- * Remove the corresponding Java annotation from the JDT DOM.
- */
- void removeAnnotation();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java
deleted file mode 100644
index fdabd0cc5f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.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;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-
-/**
- * Used to build Annotations discovered in the Java source code.
- * To provide new AnnotationDefinitions, create a new JaxbPlatform
- * by implementing JaxbPlatformDefinition.
- *
- * @see Annotation
- * @see org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition
- *
- * 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 AnnotationDefinition
-{
- /**
- * Return the name of the annotation the definition will build in the
- * various #build...(...) methods.
- */
- String getAnnotationName();
-
- /**
- * Build and return an annotation for the specified annotated element.
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement);
-
- /**
- * Build and return an annotation for the specified JDT annotation
- * on the specified annotated element.
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation);
-
- /**
- * Build and return a "null" annotation for the specified annotated element.
- * Only certain annotations are required to have "null" implementations;
- * typically the annotations with reasonably complex default behavior.
- * The "null" annotation is used by the corresponding default context model.
- * The "null" annotation simplifies the context model code, allowing the
- * context model to simply set various bits of state (e.g. 'name') and the
- * "null" annotation will create a new "real" annotation and forward the
- * new state to it. This reduces the number of null checks in the context
- * model (hopefully).
- */
- Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent);
-
-}
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 a3b2be0c5b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
+++ /dev/null
@@ -1,174 +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 package
- String PACKAGE = "javax.xml.bind.annotation";
- String PACKAGE_ = PACKAGE + '.';
-
- String ADAPTERS_PACKAGE = PACKAGE_ + "adapters";
- String ADAPTERS_PACKAGE_ = ADAPTERS_PACKAGE + '.';
-
- // ********** API **********
-
- // JAXB annotations
- String XML_ATTACHMENT_REF = PACKAGE_ + "XmlAttachmentRef";
-
- String XML_ACCESSOR_ORDER = PACKAGE_ + "XmlAccessorOrder";
- String XML_ACCESSOR_ORDER__VALUE = "value";
-
- String XML_ACCESSOR_TYPE = PACKAGE_ + "XmlAccessorType";
- String XML_ACCESSOR_TYPE__VALUE = "value";
-
- String XML_ANY_ATTRIBUTE = PACKAGE_ + "XmlAnyAttribute";
-
- String XML_ANY_ELEMENT = PACKAGE_ + "XmlAnyElement";
- String XML_ANY_ELEMENT__LAX = "lax";
- String XML_ANY_ELEMENT__VALUE = "value";
-
- String XML_ATTRIBUTE = PACKAGE_ + "XmlAttribute";
- String XML_ATTRIBUTE__NAME = "name";
- String XML_ATTRIBUTE__NAMESPACE = "namespace";
- String XML_ATTRIBUTE__REQUIRED = "required";
-
- String XML_ELEMENT = 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 = 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 = PACKAGE_ + "XmlElements";
- String XML_ELEMENTS__VALUE = "value";
-
- String XML_ELEMENT_REF = PACKAGE_ + "XmlElementRef";
- String XML_ELEMENT_REF__NAME = "name";
- String XML_ELEMENT_REF__NAMESPACE = "namespace";
- String XML_ELEMENT_REF__TYPE = "type";
-
- String XML_ELEMENT_REFS = PACKAGE_ + "XmlElementRefs";
- String XML_ELEMENT_REFS__VALUE = "value";
-
- String XML_ELEMENT_WRAPPER = 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 = PACKAGE_ + "XmlEnum";
- String XML_ENUM__VALUE = "value";
-
- String XML_ENUM_VALUE = PACKAGE_ + "XmlEnumValue";
- String XML_ENUM_VALUE__VALUE = "value";
-
- String XML_INLINE_BINARY_DATA = PACKAGE_ + "XmlInlineBinaryData";
-
- String XML_ID = PACKAGE_ + "XmlID";
-
- String XML_IDREF = PACKAGE_ + "XmlIDREF";
-
- String XML_JAVA_TYPE_ADAPTER = ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapter";
- String XML_JAVA_TYPE_ADAPTER__TYPE = "type";
- String XML_JAVA_TYPE_ADAPTER__VALUE = "value";
-
- String XML_JAVA_TYPE_ADAPTERS = ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapters";
- String XML_JAVA_TYPE_ADAPTERS__VALUE = "value";
-
- String XML_LIST = PACKAGE_ + "XmlList";
-
- String XML_MIME_TYPE = PACKAGE_ + "XmlMimeType";
- String XML_MIME_TYPE__VALUE = "value";
-
- String XML_MIXED = PACKAGE_ + "XmlMixed";
-
- String XML_NS = PACKAGE_ + "XmlNs";
- String XML_NS__NAMESPACE_URI = "namespaceURI";
- String XML_NS__PREFIX = "prefix";
-
- String XML_REGISTRY = PACKAGE_ + "XmlRegistry";
-
- String XML_ROOT_ELEMENT = PACKAGE_ + "XmlRootElement";
- String XML_ROOT_ELEMENT__NAME = "name";
- String XML_ROOT_ELEMENT__NAMESPACE = "namespace";
-
- String XML_SCHEMA = 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 = PACKAGE_ + "XmlSchemaType";
- String XML_SCHEMA_TYPE__NAME = "name";
- String XML_SCHEMA_TYPE__NAMESPACE = "namespace";
- String XML_SCHEMA_TYPE__TYPE = "type";
-
- String XML_SCHEMA_TYPES = PACKAGE_ + "XmlSchemaTypes";
- String XML_SCHEMA_TYPES__VALUE = "value";
-
- String XML_SEE_ALSO = PACKAGE_ + "XmlSeeAlso";
- String XML_SEE_ALSO__VALUE = "value";
-
- String XML_TYPE = 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_TRANSIENT = PACKAGE_ + "XmlTransient";
-
- String XML_VALUE = PACKAGE_ + "XmlValue";
-
-
- // JAXB enums
- String XML_ACCESS_ORDER = 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 = 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 = 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";
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAbstractType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAbstractType.java
deleted file mode 100644
index f64fad5738..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAbstractType.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.resource.java;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-
-/**
- * Java source code or binary type. This corresponds to a {@link AbstractTypeDeclaration}
- * (which is why the name is somewhat wonky.)
- * <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 JavaResourceAbstractType
- extends JavaResourceMember {
-
- /**
- * Property change String for the unqualified (short) type name.
- * @see JavaResourceMember#getName()
- */
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified type name.
- */
- String getQualifiedName();
- String QUALIFIED_NAME_PROPERTY = "qualifiedName"; //$NON-NLS-1$
-
- /**
- * Return the package name.
- */
- String getPackageName();
- String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$
-
- /**
- * Return the name of the type's "declaring type".
- * Return <code>null</code> if the type is a top-level type.
- */
- String getDeclaringTypeName();
- String DECLARING_TYPE_NAME_PROPERTY = "declaringTypeName"; //$NON-NLS-1$
-
- /**
- * Return whether the type is a member type.
- */
- boolean isMemberType();
- String MEMBER_TYPE_PROPERTY = "memberType"; //$NON-NLS-1$
-
- /**
- * Return whether the type is annotated with any annotations that determine whether and
- * how the type is persisted
- */
- boolean isMapped();
-
- boolean isIn(IPackageFragment packageFragment);
-
-
- /**
- * Return the immediately nested types (children).
- */
- Iterable<JavaResourceType> getTypes();
- String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Return all the types; the type itself, its children, its grandchildren,
- * etc.
- */
- Iterable<JavaResourceType> getAllTypes();
-
- /**
- * Return the immediately nested enums (children).
- */
- Iterable<JavaResourceEnum> getEnums();
- String ENUMS_COLLECTION = "enums"; //$NON-NLS-1$
-
- /**
- * Return all the enums; the enum itself, its children, its grandchildren,
- * etc.
- */
- Iterable<JavaResourceEnum> getAllEnums();
-
- /**
- * Return the kind of java type this corresponds to
- */
- Kind getKind();
-
-
- /**
- * The kind of java type.
- */
- public enum Kind {
-
- /**
- * Represents a class or interface.
- * An {@link JavaResourceAbstractType} of {@link Kind} TYPE may safely be cast as a
- * {@link JavaResourceType}
- */
- TYPE,
-
- /**
- * Represents an enum.
- * An {@link JavaResourceAbstractType} of {@link Kind} ENUM may safely be cast as a
- * {@link JavaResourceEnum}
- */
- ENUM
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java
deleted file mode 100644
index 45b14e3543..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.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.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;
-
-/**
- * Java source code or binary annotated element.
- * <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 JavaResourceAnnotatedElement
- extends JavaResourceNode
-{
- // ********** annotations **********
-
- /**
- * String associated with changes to the "annotations" collection
- */
- String ANNOTATIONS_COLLECTION = "annotations"; //$NON-NLS-1$
-
- /**
- * String associated with changes to the "nestableAnnotations" collection
- */
- String NESTABLE_ANNOTATIONS_COLLECTION = "nestableAnnotations"; //$NON-NLS-1$
-
- /**
- * Return the member's annotations in the order that they appear.
- * Do not return duplicate annotations as this error is handled by the Java
- * compiler.
- */
- Iterable<Annotation> getAnnotations();
-
- /**
- * Return the number of annotations.
- */
- int getAnnotationsSize();
-
- /**
- * Return the annotation with the specified name.
- * Return the first if there are duplicates in the source code.
- */
- Annotation getAnnotation(String annotationName);
-
- /**
- * Return the specified annotation.
- * Return the first if there are duplicates in the source code.
- * Do not return null, but a Null Object instead if no annotation
- * with the specified name exists in the source code.
- */
- Annotation getNonNullAnnotation(String annotationName);
-
- /**
- * Return the nestable annotations with the specified name in the order that
- * they appear.
- * If nestable and container annotations are both specified on the
- * member directly, the behavior is undefined
- */
- // TODO tie the singular and plural annotations together so we can generate
- // a validation error when both are specified
- ListIterable<? extends NestableAnnotation> getAnnotations(String nestableAnnotationName);
-
- /**
- * Return the number of nestable annotations with the specified name.
- * If nestable and container annotations are both specified on the
- * member directly, the behavior is undefined
- */
- int getAnnotationsSize(String nestableAnnotationName);
-
- /**
- * Return the nestable annotation at the specified index with the specified name.
- * If nestable and container annotations are both specified on the
- * member directly, the behavior is undefined
- */
- NestableAnnotation getAnnotation(int index, String nestableAnnotationName);
-
- /**
- * Add an annotation with the specified name.
- * Return the newly-created annotation.
- */
- Annotation addAnnotation(String annotationName);
-
- /**
- * Add a new nestable annotation with the specified name.
- * Create a new container annotation if necessary and add the nestable
- * annotation to it.
- * If both the nestable annotation and the container annotation already
- * exist, then add to the container annotation, leaving the existing
- * nestable annotation alone.
- * If only the nestable annotation exists, then create the new container
- * annotation and move the existing nestable annotation to it along with
- * the new one. If neither annotation exists, then create a new nestable
- * annotation.
- */
- NestableAnnotation addAnnotation(int index, String nestableAnnotationName);
-
- /**
- * Move the nestable annotation at the specified source index to the specified target index.
- */
- void moveAnnotation(int targetIndex, int sourceIndex, String nestableAnnotationName);
-
- /**
- * Remove the specified annotation.
- */
- void removeAnnotation(String annotationName);
-
- /**
- * Remove the specified nestable annotation from the container annotation at the specified
- * index.
- * If there is no container, assume the index is zero and just remove the nestable annotation
- */
- void removeAnnotation(int index, String nestableAnnotationName);
-
-
- // ********** queries **********
-
- /**
- * Return whether the underlying JDT member is currently annotated with any recognized
- * annotations.
- */
- boolean isAnnotated();
-
- /**
- * Return the text range for the member's name.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java
deleted file mode 100644
index 3f4522fc1f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java
+++ /dev/null
@@ -1,104 +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.utility.internal.iterables.ListIterable;
-
-/**
- * Java source code or binary attribute (field/method)
- *
- * 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 JavaResourceAttribute
- extends JavaResourceMember
-{
-
- /**
- * Return whether the attribute's type implements or extends the specified
- * type.
- */
- boolean typeIsSubTypeOf(String typeName);
-
- /**
- * Return whether the attribute's type is a "variable" primitive type
- * (i.e. any primitive type except 'void').
- */
- boolean typeIsVariablePrimitive();
-
- /**
- * @see java.lang.reflect.Modifier
- */
- int getModifiers();
- String MODIFIERS_PROPERTY = "modifiers"; //$NON-NLS-1$
-
- /**
- * Return the resolved, qualified name of the attribute's type
- * (e.g. "java.util.Collection" or "byte[]").
- * If the type is an array, this name will include the appropriate number
- * of bracket pairs.
- * This name will not include the type's generic type arguments
- * (e.g. "java.util.Collection<java.lang.String>" will only return
- * "java.util.Collection").
- * @see #typeTypeArgumentNames()
- */
- String getTypeName();
- String TYPE_NAME_PROPERTY = "typeName"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is an interface.
- */
- boolean typeIsInterface();
- String TYPE_IS_INTERFACE_PROPERTY = "typeIsInterface"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is an enum.
- */
- boolean typeIsEnum();
- String TYPE_IS_ENUM_PROPERTY = "typeIsEnum"; //$NON-NLS-1$
-
- /**
- * Return whether the attribute type is an array.
- */
- boolean typeIsArray();
- String TYPE_IS_ARRAY_PROPERTY = "typeIsArray"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's superclasses.
- */
- ListIterable<String> getTypeSuperclassNames();
- String TYPE_SUPERCLASS_NAMES_LIST = "typeSuperclassNames"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's interfaces.
- */
- Iterable<String> getTypeInterfaceNames();
- String TYPE_INTERFACE_NAMES_COLLECTION = "typeInterfaceNames"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's type arguments.
- * The name for any argument that is an array will contain the appropriate
- * number of bracket pairs.
- * The names will not include any further generic type arguments.
- */
- ListIterable<String> getTypeTypeArgumentNames();
- String TYPE_TYPE_ARGUMENT_NAMES_LIST = "typeTypeArgumentNames"; //$NON-NLS-1$
-
- int getTypeTypeArgumentNamesSize();
-
- String getTypeTypeArgumentName(int index);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java
deleted file mode 100644
index 2267bcb4ea..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.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.resource.java;
-
-
-/**
- * Java class file
- *
- * 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 JavaResourceClassFile
- extends JavaResourceNode
-{
- /**
- * Return the class file's persistent type.
- */
- JavaResourceType getPersistentType();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java
deleted file mode 100644
index 5fe1d8e3b2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.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.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.CommandExecutor;
-
-/**
- * Dali resource for JDT compilation unit.
- *
- * 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 JavaResourceCompilationUnit
- extends JavaResourceNode.Root
-{
- /**
- * Return the corresponding JDT compilation unit.
- */
- ICompilationUnit getCompilationUnit();
-
- /**
- * Return the JPA project's annotation formatter. This is used to make any
- * manipulated annotations reasonably readable after being written to the
- * Java source file.
- */
- AnnotationEditFormatter getAnnotationEditFormatter();
-
- /**
- * This allows the resource model to modify the Java source code on the
- * UI thread when it is executing on another thread.
- */
- CommandExecutor getModifySharedDocumentCommandExecutor();
-
- /**
- * Resolve type information that could be dependent on other files being
- * added/removed.
- */
- void resolveTypes();
-
- /**
- * Something in Java has changed (typically either the compilation unit's
- * source code or the Java classpath); synchronize the compilation unit's
- * state with the Java source code etc.
- */
- void synchronizeWithJavaSource();
-
- /**
- * Build an AST for the compilation unit with its bindings resolved.
- */
- CompilationUnit buildASTRoot();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnum.java
deleted file mode 100644
index 647be4d372..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnum.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.resource.java;
-
-
-/**
- * Java source code or binary enum.
- * <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 JavaResourceEnum
- extends JavaResourceAbstractType
-{
-
-
- // ********** enum constants **********
-
- /**
- * Return the enum's enum constants.
- */
- Iterable<JavaResourceEnumConstant> getEnumConstants();
- String ENUM_CONSTANTS_COLLECTION = "enumConstants"; //$NON-NLS-1$
-//
-// /**
-// * Return the type's persistable fields.
-// */
-// Iterable<JavaResourceAttribute> getPersistableFields();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnumConstant.java
deleted file mode 100644
index e7ab99a4ee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceEnumConstant.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.resource.java;
-
-/**
- * Java source code or binary enum constant
- *
- * 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 JavaResourceEnumConstant
- extends JavaResourceMember
-{
- /**
- * The Java resource enum constant's name does not change.
- */
- String getName();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceField.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceField.java
deleted file mode 100644
index a5c82bd549..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceField.java
+++ /dev/null
@@ -1,27 +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;
-
-/**
- * Java source code or binary field
- *
- * 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 JavaResourceField
- extends JavaResourceAttribute
-{
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java
deleted file mode 100644
index a873e558c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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;
-
-/**
- * Java source code or binary persistent member.
- * <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 2.0
- */
-public interface JavaResourceMember
- extends JavaResourceAnnotatedElement
-{
- String getName();
-
- // ********** annotations **********
-
- /**
- * Sets the specified primary annotation as the first annotation, and removes all known
- * annotations (i.e. does not remove non-persistence annotations) which are not included
- * in the supporting annotations.
- */
- Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames);
-
-
-
- // ********** modifiers **********
-
- /**
- * Return whether the member is final.
- */
- boolean isFinal();
- String FINAL_PROPERTY = "final"; //$NON-NLS-1$
-
- boolean isTransient();
- String TRANSIENT_PROPERTY = "transient"; //$NON-NLS-1$
-
- boolean isPublic();
- String PUBLIC_PROPERTY = "public"; //$NON-NLS-1$
-
- boolean isStatic();
- String STATIC_PROPERTY = "static"; //$NON-NLS-1$
-
-
- // ********** queries **********
-
- /**
- * Return whether the Java resource member is for the specified
- * member.
- */
- boolean isFor(String memberName, int occurrence);
-
-
- // ********** behavior **********
-
- /**
- * Resolve type information that could be dependent on changes elsewhere
- * in the workspace.
- */
- void resolveTypes(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMethod.java
deleted file mode 100644
index 1ab479b6a8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMethod.java
+++ /dev/null
@@ -1,50 +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.jpt.common.utility.MethodSignature;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Java source code or binary method
- *
- * 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 JavaResourceMethod
- extends JavaResourceAttribute
-{
-
- /**
- * The Java resource method's name does not change.
- */
- String getMethodName();
-
- /**
- * Return whether the Java resource persistent attribute is for the specified
- * method.
- */
- boolean isFor(MethodSignature methodSignature, int occurrence);
-
- ListIterable<String> getParameterTypeNames();
- String PARAMETER_TYPE_NAMES_LIST = "parameterTypeNames"; //$NON-NLS-1$
-
- int getParametersSize();
-
- boolean isConstructor();
- String CONSTRUCTOR_PROPERTY = "constructor"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java
deleted file mode 100644
index a223fa243d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java
+++ /dev/null
@@ -1,93 +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.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.jaxb.core.AnnotationProvider;
-
-/**
- * Common interface for Java resource nodes (source code or binary).
- * <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 JavaResourceNode
- extends Model
-{
-
- /**
- * Return the Eclipse file that contains the Java resource node
- * (typically either a Java source code file or a JAR).
- */
- IFile getFile();
-
- /**
- * Return the root of the Java resource containment hierarchy
- * (typically either a compilation unit or a package fragment root).
- */
- Root getRoot();
-
- /**
- * Return the [source] node's root (the compilation unit).
- */
- // TODO get rid of this method...?
- JavaResourceCompilationUnit getJavaResourceCompilationUnit();
-
- /**
- * Return the [source] node's text range in the compilation unit's file.
- */
- TextRange getTextRange(CompilationUnit astRoot);
-
- /**
- * Initialize the [source] node from the specified AST.
- */
- void initialize(CompilationUnit astRoot);
-
- /**
- * Synchronize the [source] node with the specified AST.
- */
- void synchronizeWith(CompilationUnit astRoot);
-
-
- /**
- * Root of Java resource model containment hierarchy.
- */
- interface Root
- extends JavaResourceNode, JptResourceModel {
-
- /**
- * Return the root's Java resource "abstract" types.
- */
- Iterable<JavaResourceAbstractType> getTypes();
- String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Called (via a hook in change notification) whenever anything in the
- * Java resource model changes. Forwarded to listeners.
- */
- void resourceModelChanged();
-
- /**
- * Return the annotation provider that supplies the annotations found
- * in the Java resource model.
- */
- AnnotationProvider getAnnotationProvider();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
deleted file mode 100644
index ac15223fe1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * @author Dmitry Geraskov
- *
- * Java source code of package-info
- * <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.
- */
-public interface JavaResourcePackage
- extends JavaResourceAnnotatedElement {
-
- /**
- * The Java resource persistent package's name.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java
deleted file mode 100644
index f488cc96a9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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;
-
-
-/**
- * Java package fragment
- *
- * 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 2.2
- * @since 2.2
- */
-public interface JavaResourcePackageFragment
- extends JavaResourceNode
-{
- /**
- * Return the package fragment's class files that contain "persistable" types.
- */
- Iterable<JavaResourceClassFile> getClassFiles();
- String CLASS_FILES_COLLECTION = "classFiles"; //$NON-NLS-1$
-
- /**
- * Return the size of the package fragment's class files.
- */
- int getClassFilesSize();
-
- /**
- * Return the package fragment's Java persistent types.
- * Return only the files that are annotated with JAXB annotations.
- */
- Iterable<JavaResourceType> getPersistedTypes();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java
deleted file mode 100644
index e23bc87f4f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 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;
-
-
-/**
- * Java package fragement root
- *
- * 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 2.2
- * @since 2.2
- */
-public interface JavaResourcePackageFragmentRoot
- extends JavaResourceNode.Root
-{
- /**
- * Return the package fragment root's package fragments.
- */
- Iterable<JavaResourcePackageFragment> getPackageFragments();
- String PACKAGE_FRAGMENTS_COLLECTION = "packageFragments"; //$NON-NLS-1$
-
- /**
- * Return the size of the package fragment root's package fragments.
- */
- int getPackageFragmentsSize();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java
deleted file mode 100644
index 29a829c232..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.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.resource.java;
-
-/**
- * Dali resource for JDT compilation unit named package-info.java.
- *
- * 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 JavaResourcePackageInfoCompilationUnit
- extends JavaResourceCompilationUnit
-{
- JavaResourcePackage getPackage();
- String PACKAGE = "package"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java
deleted file mode 100644
index b1cc21a9e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.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;
-
-/**
- * Java source code or binary class or interface.
- * <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 2.0
- */
-public interface JavaResourceType
- extends JavaResourceAbstractType
-{
-
- /**
- * Return the fully qualified name of the type's superclass.
- */
- String getSuperclassQualifiedName();
- String SUPERCLASS_QUALIFIED_NAME_PROPERTY = "superclassQualifiedName"; //$NON-NLS-1$
-
- /**
- * Return whether the type is abstract.
- */
- boolean isAbstract();
- String ABSTRACT_PROPERTY = "abstract"; //$NON-NLS-1$
-
- /**
- * Return whether the type has a no-arg constructor (private, protected, or public)
- */
- boolean hasNoArgConstructor();
- String NO_ARG_CONSTRUCTOR_PROPERTY = "noArgConstructor"; //$NON-NLS-1$
-
-
- // ********** fields **********
-
- /**
- * Return the type's fields.
- */
- Iterable<JavaResourceField> getFields();
- String FIELDS_COLLECTION = "fields"; //$NON-NLS-1$
-
-
- // ********** methods **********
-
- /**
- * Return the type's methods. This returns *all* methods from the JDT Type
- */
- Iterable<JavaResourceMethod> getMethods();
- String METHODS_COLLECTION = "methods"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbContainmentAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbContainmentAnnotation.java
deleted file mode 100644
index d5a606aa56..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbContainmentAnnotation.java
+++ /dev/null
@@ -1,86 +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;
-
-/**
- *
- * 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 JaxbContainmentAnnotation
- extends Annotation
-{
-
- /**
- * Corresponds to the 'name' element of the XmlAttribute annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlAttribute 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 XmlAttribute annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlAttribute 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 XmlAttribute 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 XmlAttribute annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * 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/NestableAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java
deleted file mode 100644
index 4fcae43c04..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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;
-
-/**
- * Interface for dealing with annotations that can be "nested" within other
- * annotations, typically within arrays.
- *
- * 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 2.0
- */
-public interface NestableAnnotation
- extends Annotation
-{
- /**
- * Move the annotation to the specified index within its container annotation.
- * This should only be called when the annotation is actually nested.
- */
- void moveAnnotation(int index);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotationDefinition.java
deleted file mode 100644
index 403e8a52b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotationDefinition.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.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-
-/**
- * Used to build NestableAnnotations discovered in the Java source code.
- * To provide new NestableAnnotationDefinitions, create a new JaxbPlatform
- * by implementing JaxbPlatformDefinition.
- *
- * @see NestableAnnotation
- * @see org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition
- *
- * 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 NestableAnnotationDefinition
-{
- /**
- * Return the name of the annotation the definition will build in the
- * various #build...(...) methods.
- */
- String getNestableAnnotationName();
-
- String getContainerAnnotationName();
-
- String getElementName();
-
- /**
- * Build and return an annotation for the specified annotated element.
- */
- NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index);
-
- /**
- * Build and return an annotation for the specified JDT annotation
- * on the specified annotated element.
- */
- Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation);
-}
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 f4055f4ae6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,52 +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.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
-{
- String ANNOTATION_NAME = JAXB.XML_ACCESSOR_ORDER;
-
- /**
- * 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 bc6d0e1e04..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,52 +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.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
-{
- String ANNOTATION_NAME = JAXB.XML_ACCESSOR_TYPE;
-
- /**
- * 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 2a0f79dd4e..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_ANY_ATTRIBUTE;
-
-}
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 ecff447a9c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,86 +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.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
-{
- String ANNOTATION_NAME = JAXB.XML_ANY_ELEMENT;
-
- /**
- * 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 f02dfaeba5..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_ATTACHMENT_REF;
-
-}
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 d953ee52a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
+++ /dev/null
@@ -1,30 +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 JaxbContainmentAnnotation
-{
- String ANNOTATION_NAME = JAXB.XML_ATTRIBUTE;
-
-}
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 6a0d5f68a8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
+++ /dev/null
@@ -1,104 +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.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 JaxbContainmentAnnotation, NestableAnnotation
-{
- String ANNOTATION_NAME = JAXB.XML_ELEMENT;
-
- /**
- * 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 349a7aea5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.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.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 Annotation
-{
- String ANNOTATION_NAME = JAXB.XML_ELEMENT_DECL;
-
- /**
- * Corresponds to the 'name' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlElementDecl 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 XmlElementDecl annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlElementDecl 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 XmlElementDecl 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 XmlElementDecl annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl 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 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);
-
- /**
- * 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();
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- /**
- * 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);
-
- /**
- * 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();
- String FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY = "fullyQualifiedScopeClassName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadName();
- String SUBSTITUTION_HEAD_NAME_PROPERTY = "substitutionHeadName"; //$NON-NLS-1$
-
- /**
- * 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);
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadNamespace();
- String SUBSTITUTION_HEAD_NAMESPACE_PROPERTY = "substitutionHeadNamespace"; //$NON-NLS-1$
-
- /**
- * 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);
-
-}
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 469606260b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.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.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.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 NestableAnnotation
-{
- String ANNOTATION_NAME = JAXB.XML_ELEMENT_REF;
-
- /**
- * Corresponds to the 'name' element of the XmlElementRef annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlElementRef 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 XmlElementRef annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlElementRef 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 XmlElementRef 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 XmlElementRef annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'type' element of the XmlElementRef 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();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlElementRef 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 XmlElementRef annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * 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();
- 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/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 ed11d770a1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.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.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 Annotation
-{
- String ANNOTATION_NAME = JAXB.XML_ELEMENT_WRAPPER;
-
- /**
- * Corresponds to the 'name' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlElementWrapper 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 XmlElementWrapper annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlElementWrapper 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 XmlElementWrapper 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 XmlElementWrapper annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * 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 86a145c54b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.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.resource.java;
-
-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
-{
- String ANNOTATION_NAME = JAXB.XML_ELEMENTS;
-
-
- /**
- * 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 affaa665fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
+++ /dev/null
@@ -1,67 +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.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
-{
- String ANNOTATION_NAME = JAXB.XML_ENUM;
-
- /**
- * 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 1692615046..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.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.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.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 ANNOTATION_NAME = JAXB.XML_ENUM_VALUE;
-
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue 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 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);
-
-}
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 98379fdbe0..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_ID;
-
-}
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 eea217cdf6..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_IDREF;
-
-}
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 1e1e7c97ec..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_INLINE_BINARY_DATA;
-
-}
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 6b85cdc0f2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.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.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.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 {
-
- String ANNOTATION_NAME = JAXB.XML_JAVA_TYPE_ADAPTER;
-
- /**
- * 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 6b32924649..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_LIST;
-
-}
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 d81da94c74..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,52 +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.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
-{
- String ANNOTATION_NAME = JAXB.XML_MIME_TYPE;
-
- /**
- * 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 832cb98570..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_MIXED;
-
-}
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 6b562d4f7e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.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.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.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 {
-
- String ANNOTATION_NAME = JAXB.XML_NS;
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespaceURI();
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- /**
- * 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 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getNamespaceURITextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getPrefix();
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-
- /**
- * 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);
-}
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 0ed5752e78..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_REGISTRY;
-
-}
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 b49eebe824..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.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.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.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 Annotation
-{
- String ANNOTATION_NAME = JAXB.XML_ROOT_ELEMENT;
-
- /**
- * Corresponds to the 'name' element of the XmlRootElement annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlRootElement 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 XmlRootElement annotation.
- */
- 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);
-
- /**
- * Corresponds to the 'namespace' element of the XmlRootElement 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 XmlRootElement 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 XmlRootElement 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);
-}
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 6f60a1ef0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.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.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.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 {
-
- String ANNOTATION_NAME = JAXB.XML_SCHEMA;
-
- /**
- * 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 8b9c76b7a5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,117 +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.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 NestableAnnotation {
-
- String ANNOTATION_NAME = JAXB.XML_SCHEMA_TYPE;
-
- /**
- * Corresponds to the 'name' element of the XmlSchemaType annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlSchemaType 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 XmlSchemaType annotation.
- */
- 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);
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchemaType 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 XmlSchemaType 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 XmlSchemaType 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 '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();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * 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);
-
- /**
- * 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();
- 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/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 338dd731d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,84 +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.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 {
-
- String ANNOTATION_NAME = JAXB.XML_SEE_ALSO;
-
- /**
- * 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 65a62172ff..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_TRANSIENT;
-
-}
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 3596982875..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
+++ /dev/null
@@ -1,175 +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.0
- * @since 3.0
- */
-public interface XmlTypeAnnotation
- extends Annotation {
-
- String ANNOTATION_NAME = JAXB.XML_TYPE;
-
- /**
- * 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();
- String FACTORY_CLASS_PROPERTY = "factoryClass"; //$NON-NLS-1$
-
- /**
- * 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);
-
- /**
- * 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();
- String FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY = "fullyQualifiedFactoryClassName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- */
- String getFactoryMethod();
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * 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);
-
- /**
- * Corresponds to the 'name' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the XmlType 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 XmlType annotation.
- */
- 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);
-
- /**
- * Corresponds to the 'namespace' element of the XmlType 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 XmlType 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 XmlType 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 'propOrder' element of the XmlType annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<String> getPropOrder();
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * 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);
-
-}
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 74fa320c04..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;
-
-
-/**
- * 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
-{
- String ANNOTATION_NAME = JAXB.XML_VALUE;
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAdapter.java
deleted file mode 100644
index 7ad4345bf1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAdapter.java
+++ /dev/null
@@ -1,27 +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;
-
-
-public class XsdAdapter
- extends AdapterImpl {
-
- protected XsdAdapter() {
- super();
- }
-
-
- @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/XsdComplexTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
deleted file mode 100644
index 53b457aa34..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.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.XSDComplexTypeDefinition;
-
-
-public class XsdComplexTypeDefinition
- extends XsdTypeDefinition {
-
- XsdComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition) {
- super(xsdComplexTypeDefinition);
- }
-}
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 d27229f828..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.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.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XsdElementDeclaration
- extends XsdAdapter {
-
- protected final XSDElementDeclaration xsdElementDeclaration;
-
-
- XsdElementDeclaration(XSDElementDeclaration xsdElementDeclaration) {
- super();
- this.xsdElementDeclaration = xsdElementDeclaration;
- }
-
-
- public String getName() {
- return this.xsdElementDeclaration.getName();
- }
-
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = this.xsdElementDeclaration.getTypeDefinition();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-}
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 e8c9e01b53..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
+++ /dev/null
@@ -1,202 +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 XsdAdapter {
-
- protected final XSDSchema xsdSchema;
-
-
-
- XsdSchema(XSDSchema xsdSchema) {
- super();
- this.xsdSchema = xsdSchema;
- }
-
-
- public Iterable<String> getNamespaces() {
- return new SnapshotCloneIterable(this.xsdSchema.getQNamePrefixToNamespaceMap().values());
- }
-
- 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);
- }
- };
- }
-
- public XsdTypeDefinition getTypeDefinition(String namespace, String name) {
- for (XSDTypeDefinition typeDefinition : getXSDTypeDefinitions(namespace)) {
- if (typeDefinition.getTargetNamespace().equals(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(this.xsdSchema.getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getBuiltInXSDTypeDefinitions() {
- return new SnapshotCloneIterable(this.xsdSchema.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 namespace.equals(o.getTargetNamespace());
- }
- };
- }
-
- 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 o.getTargetNamespace().equals(namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public XsdElementDeclaration getElementDeclaration(String namespace, String name) {
- for (XSDElementDeclaration elementDeclaration : getXSDElementDeclarations()) {
- if (elementDeclaration.getTargetNamespace().equals(namespace) && elementDeclaration.getName().equals(name)) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(elementDeclaration);
- }
- }
- return null;
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations() {
- return new SnapshotCloneIterable(this.xsdSchema.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));
- }
-
-} \ No newline at end of file
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 c50310c85f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.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.XSDSimpleTypeDefinition;
-
-
-public class XsdSimpleTypeDefinition
- extends XsdTypeDefinition {
-
- XsdSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
- super(xsdSimpleTypeDefinition);
- }
-}
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 85d95bbf9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.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.xsd;
-
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public abstract class XsdTypeDefinition
- extends XsdAdapter {
-
- protected final XSDTypeDefinition xsdTypeDefinition;
-
-
- protected XsdTypeDefinition(XSDTypeDefinition xsdTypeDefinition) {
- super();
- this.xsdTypeDefinition = xsdTypeDefinition;
- }
-
-
- public String getName() {
- return this.xsdTypeDefinition.getName();
- }
-}
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 c4882c9b48..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
+++ /dev/null
@@ -1,194 +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.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-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 String getResolvedUri(String namespace, 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);
- }
- }
- catch (MalformedURLException me) {
- JptJaxbCorePlugin.log(me);
- resolvedUri = null;
- }
- catch (IOException ie) {
- JptJaxbCorePlugin.log(ie);
- resolvedUri = null;
- }
- }
-
- if (resolvedUri == null && namespace != null) {
- if ( ! (location != null && location.endsWith(".xsd"))) { //$NON-NLS-1$
- try {
- resolvedUri = catalog.resolvePublic(namespace, location);
- if (resolvedUri == null) {
- resolvedUri = catalog.resolveURI(namespace);
- }
- }
- 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;
- }
-
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding EMF object.
- */
- public static XSDSchema buildXSDModel(String uriString) {
- XSDSchema xsdSchema = null;
-
- try {
- // 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);
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
- XSDResourceImpl resource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
- resource.setURI(uri);
- resource.load(inputStream, null);
- xsdSchema = resource.getSchema();
- }
- handleImports(xsdSchema);
- }
- catch (Exception e) {
- JptJaxbCorePlugin.log(e);
- }
- 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 caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- return new XsdSimpleTypeDefinition(object);
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- return new XsdComplexTypeDefinition(object);
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- return new XsdElementDeclaration(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);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project
deleted file mode 100644
index d123fb8513..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <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>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 0eb6ebdab2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.branding;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/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>June 06, 2007</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> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties
deleted file mode 100644
index c14c83b9e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +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
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink MOXy (JAXB) Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties
deleted file mode 100644
index d6bd03a94b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,17 +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
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml
deleted file mode 100644
index a2db2d1b9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jaxb.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jaxb.eclipselink.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties
deleted file mode 100644
index d3fad8a20b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink MOXy (JAXB) Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath
deleted file mode 100644
index bbf9ced68e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <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"/>
- <classpathentry exported="true" kind="lib" path="lib/eclipselink.jar" sourcepath="lib/eclipselink-src.zip"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project
deleted file mode 100644
index a482c34f48..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.core.schemagen</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.eclipselink.core.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index eea3432f5d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core.schemagen;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-ClassPath: lib/eclipselink.jar
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core.schemagen,
- org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/about.html
+++ /dev/null
@@ -1,47 +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">
-
-<H2>About This Content</H2>
-
-<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>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties
deleted file mode 100644
index a3ffe71f6c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/build.properties
+++ /dev/null
@@ -1,20 +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
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- lib/eclipselink.jar,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink-src.zip b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink-src.zip
deleted file mode 100644
index 68a5393d4f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink-src.zip
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink.jar b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink.jar
deleted file mode 100644
index 855e644c5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/lib/eclipselink.jar
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties
deleted file mode 100644
index c05741163a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - EclipseLink JAXB Support - Schema Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java
deleted file mode 100644
index 0ae05f139f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/Main.java
+++ /dev/null
@@ -1,290 +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.eclipselink.core.schemagen;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal.JptEclipseLinkJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal.Tools;
-import org.eclipse.persistence.jaxb.JAXBContext;
-import org.eclipse.persistence.jaxb.JAXBContextFactory;
-
-/**
- * Generate a EclipseLink JAXB Schema
- *
- * Current command-line arguments:
- * [-s schema.xsd] - specifies the target schema
- * [-c className] - specifies the fully qualified class name
- */
-public class Main
-{
- private String[] sourceClassNames;
- private String targetSchemaName;
- @SuppressWarnings("unused")
- private boolean isDebugMode;
-
- static public String NO_FACTORY_CLASS = "doesnt contain ObjectFactory.class"; //$NON-NLS-1$
- static public String CANNOT_BE_CAST_TO_JAXBCONTEXT = "cannot be cast to org.eclipse.persistence.jaxb.JAXBContext"; //$NON-NLS-1$
-
- // ********** static methods **********
-
- public static void main(String[] args) {
- new Main().execute(args);
- }
-
- // ********** constructors **********
-
- private Main() {
- super();
- }
-
- // ********** behavior **********
-
- protected void execute(String[] args) {
-
- this.initializeWith(args);
-
- this.generate();
- }
-
- // ********** internal methods **********
-
- private void initializeWith(String[] args) {
- this.sourceClassNames = this.getSourceClassNames(args);
- this.targetSchemaName = this.getTargetSchemaName(args);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void generate() {
- // Create the JAXBContext
- JAXBContext jaxbContext = this.buildJaxbContext();
-
- // Generate an XML Schema
- if(jaxbContext != null) {
- this.generateSchema(jaxbContext);
- }
- else {
- Tools.bind(JptEclipseLinkJaxbCoreMessages.SCHEMA_NOT_CREATED, this.targetSchemaName);
- }
- }
-
- private JAXBContext buildJaxbContext() {
- System.out.println(Tools.getString(JptEclipseLinkJaxbCoreMessages.LOADING_CLASSES));
- JAXBContext jaxbContext = null;
- try {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- Class[] sourceClasses = this.buildSourceClasses(this.sourceClassNames, loader);
-
- //call MOXy JAXBContextFactory directly. This eliminates the need to have the JAXB properties file in place
- //in time for the generation.
- jaxbContext = (JAXBContext)JAXBContextFactory.createContext(sourceClasses, Collections.<String,Object>emptyMap());
- }
- catch (JAXBException ex) {
- this.handleJaxbException(ex);
- }
- catch (ClassCastException ex) {
- this.handleClassCastException(ex);
- }
- return jaxbContext;
- }
-
- private void generateSchema(JAXBContext jaxbContext) {
- System.out.println(Tools.getString(JptEclipseLinkJaxbCoreMessages.GENERATING_SCHEMA));
- System.out.flush();
-
- SchemaOutputResolver schemaOutputResolver =
- new JptSchemaOutputResolver(this.targetSchemaName);
-
- try {
- jaxbContext.generateSchema(schemaOutputResolver);
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
-
- private Class[] buildSourceClasses(String[] classNames, ClassLoader loader) {
-
- ArrayList<Class> sourceClasses = new ArrayList<Class>(classNames.length);
- for(String className: classNames) {
- try {
- sourceClasses.add(loader.loadClass(className));
- System.out.println(className);
- }
- catch (ClassNotFoundException e) {
- System.err.println(Tools.bind(JptEclipseLinkJaxbCoreMessages.NOT_FOUND, className));
- }
- }
- System.out.flush();
- return sourceClasses.toArray(new Class[0]);
- }
-
- private void handleJaxbException(JAXBException ex) {
- String message = ex.getMessage();
- Throwable linkedEx = ex.getLinkedException();
- if(message != null && message.indexOf(NO_FACTORY_CLASS) > -1) {
- System.err.println(message);
- }
- else if(linkedEx != null && linkedEx instanceof ClassNotFoundException) {
- String errorMessage = Tools.bind(
- JptEclipseLinkJaxbCoreMessages.CONTEXT_FACTORY_NOT_FOUND, linkedEx.getMessage());
- System.err.println(errorMessage);
- }
- else {
- ex.printStackTrace();
- }
- }
-
- private void handleClassCastException(ClassCastException ex) {
- String message = ex.getMessage();
- if(message != null && message.indexOf(CANNOT_BE_CAST_TO_JAXBCONTEXT) > -1) {
- System.err.println(Tools.getString(JptEclipseLinkJaxbCoreMessages.PROPERTIES_FILE_NOT_FOUND));
- }
- else {
- ex.printStackTrace();
- }
- }
-
- // ********** argument queries **********
-
- private String[] getSourceClassNames(String[] args) {
-
- return this.getAllArgumentValues("-c", args); //$NON-NLS-1$
- }
-
- private String getTargetSchemaName(String[] args) {
-
- return this.getArgumentValue("-s", args); //$NON-NLS-1$
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- // ********** private methods **********
-
- private String getArgumentValue(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private String[] getAllArgumentValues(String argName, String[] args) {
- List<String> argValues = new ArrayList<String>();
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- int j = i + 1;
- if (j < args.length) {
- argValues.add(args[j]);
- i++;
- }
- }
- }
- return argValues.toArray(new String[0]);
- }
-
- private boolean argumentExists(String argName, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argName)) {
- return true;
- }
- }
- return false;
- }
-
-}
-
-// ********** inner class **********
-
-class JptSchemaOutputResolver extends SchemaOutputResolver {
-
- private String defaultSchemaName;
-
- // ********** constructor **********
-
- protected JptSchemaOutputResolver(String defaultSchemaName) {
- this.defaultSchemaName = defaultSchemaName;
- }
-
- // ********** overrides **********
-
- @Override
- public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException {
-
- String filePath = (Tools.stringIsEmpty(namespaceURI)) ?
- this.buildFileNameFrom(this.defaultSchemaName, suggestedFileName) :
- this.modifyFileName(namespaceURI);
-
- File file = new File(filePath);
- StreamResult result = new StreamResult(file);
- result.setSystemId(file.toURI().toURL().toString());
-
- System.out.print(Tools.bind(JptEclipseLinkJaxbCoreMessages.SCHEMA_GENERATED, file));
- return result;
- }
-
- // ********** private methods **********
-
- private String buildFileNameFrom(String fileName, String suggestedFileName) {
-
- fileName = Tools.stripExtension(fileName);
-
- if(Tools.stringIsEmpty(fileName)) {
- return suggestedFileName;
- }
- String number = Tools.extractFileNumber(suggestedFileName);
-
- fileName = this.buildFileName(fileName, number);
- return Tools.appendXsdExtension(fileName);
- }
-
- private String buildFileName(String fileName, String number) {
-
- if(Tools.stringIsEmpty(number)) {
- return fileName;
- }
- return (number.equals("0")) ? fileName : fileName + number; //$NON-NLS-1$
- }
-
- private String modifyFileName(String namespaceURI) throws IOException {
-
- String dir = Tools.extractDirectory(this.defaultSchemaName);
-
- String fileName = Tools.stripProtocol(namespaceURI);
- fileName = fileName.replaceAll("/", "_"); //$NON-NLS-1$
- fileName = Tools.appendXsdExtension(fileName);
-
- String result = (Tools.stringIsEmpty(dir)) ? fileName : dir + File.separator + fileName;
-
- return result;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java
deleted file mode 100644
index 65a9e2eee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.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.eclipselink.core.schemagen.internal;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localized messages used by Dali EclipseLink JAXB core.
- */
-public class JptEclipseLinkJaxbCoreMessages
-{
- public static final String LOADING_CLASSES = "LOADING_CLASSES";
- public static final String GENERATING_SCHEMA = "GENERATING_SCHEMA";
- public static final String SCHEMA_GENERATED = "SCHEMA_GENERATED";
- public static final String SCHEMA_NOT_CREATED = "SCHEMA_NOT_CREATED";
- public static final String NOT_FOUND = "NOT_FOUND";
- public static final String CONTEXT_FACTORY_NOT_FOUND = "CONTEXT_FACTORY_NOT_FOUND";
- public static final String PROPERTIES_FILE_NOT_FOUND = "PROPERTIES_FILE_NOT_FOUND";
-
-
- private static final String BUNDLE_NAME = "org.eclipse.jpt.jaxb.eclipselink.core.schemagen.internal.jpt_eclipselink_jaxb_core"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private JptEclipseLinkJaxbCoreMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.java
deleted file mode 100644
index 5a32e4c09c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/Tools.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.eclipselink.core.schemagen.internal;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-/**
- * Tools
- */
-public final class Tools
-{
- /** default file name used by the schemagen */
- static public String GEN_DEFAULT_NAME = "schema"; //$NON-NLS-1$
-
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- // ********** queries **********
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(String string) {
- if (string == null) {
- return true;
- }
- int len = string.length();
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string.toCharArray(), len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- // ********** short name manipulation **********
-
- /**
- * Strip the extension from the specified file name
- * and return the result. If the file name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return fileName;
- }
- return fileName.substring(0, index);
- }
-
- public static String stripProtocol(String uri) {
-
- return uri.replaceFirst("http://", EMPTY_STRING);
- }
-
-
- public static String appendXsdExtension(String name) {
-
- return name + ".xsd"; //$NON-NLS-1$
- }
-
- public static String extractFileNumber(String fileName) {
-
- String result = stripExtension(fileName);
- if(Tools.stringIsEmpty(result)) {
- return EMPTY_STRING;
- }
- return result.replaceFirst(GEN_DEFAULT_NAME, EMPTY_STRING);
- }
-
- public static String extractDirectory(String path) {
- if( ! path.contains(File.separator)) {
- return EMPTY_STRING;
- }
- return path.substring(0, path.lastIndexOf(File.separator));
- }
-
- // ********** NLS utilities **********
-
- public static String getString(String key) {
- return JptEclipseLinkJaxbCoreMessages.getString(key);
- }
-
- public static String bind(String key, Object argument) {
- return MessageFormat.format(getString(key), argument);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
deleted file mode 100644
index a9f76617fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/src/org/eclipse/jpt/jaxb/eclipselink/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
+++ /dev/null
@@ -1,21 +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
-################################################################################
-
-LOADING_CLASSES = loading...
-GENERATING_SCHEMA = \nMOXy generating schema...
-SCHEMA_GENERATED = \nSchema {0} generated
-SCHEMA_NOT_CREATED = \nSchema {0} not created
-NOT_FOUND = \n\tNot found: {0}
-PROPERTIES_FILE_NOT_FOUND = \nEclipseLink JAXBContextFactory must be specified in the jaxb.properties file to use EclipseLink MOXy for schema generation.\n\
-javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
-CONTEXT_FACTORY_NOT_FOUND = \nThe JAXBContextFactory {0} \n\
-specified in the jaxb.properties file could not be located on the project classpath. \n\
-The JAXB provider that defines this factory should be added to the project classpath, \n\
-or the jaxb.properties file should be removed to use the default provider.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath
deleted file mode 100644
index 934fb38085..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath
+++ /dev/null
@@ -1,13 +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/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project
deleted file mode 100644
index 67371280df..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.ui</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.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index af73ce27df..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,50 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.ui;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jaxb.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.jst.common.project.facet.ui;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.common.ui;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.web.ui;bundle-version="[1.1.400,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.500,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.ui,
- org.eclipse.jpt.jaxb.ui.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.actions;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.filters;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.jaxb21;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.jaxb22;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.navigator;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.platform;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.properties;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.facet;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.proj;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.proj.model;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.navigator,
- org.eclipse.jpt.jaxb.ui.platform
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/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.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
deleted file mode 100644
index 6eca01337e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
+++ /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
-################################################################################
-javacSource = 1.5
-javacTarget = 1.5
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- icons/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = schema/
- \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml
deleted file mode 100644
index 04957fe9b2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/component.xml
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jaxb.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
deleted file mode 100644
index b6efdd3d86..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif
deleted file mode 100644
index e75a17c2d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif
deleted file mode 100644
index b547717598..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
deleted file mode 100644
index a1c6545cd6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif
deleted file mode 100644
index cc0eeb7196..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif
deleted file mode 100644
index 3c0acadd2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
deleted file mode 100644
index d4cb4254d9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif
deleted file mode 100644
index e75a17c2d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif
deleted file mode 100644
index 70a9c23541..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif
deleted file mode 100644
index 131c28da40..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_class.gif
deleted file mode 100644
index baac236770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_class.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gif
deleted file mode 100644
index 679ca81e14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_enum.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
deleted file mode 100644
index d4cb4254d9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
deleted file mode 100644
index 7d24707ee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/registry.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/registry.gif
deleted file mode 100644
index baac236770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/registry.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/transient_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/transient_class.gif
deleted file mode 100644
index 066461be61..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/transient_class.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif
deleted file mode 100644
index 5b01857f30..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif
deleted file mode 100644
index d68d73f340..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif
deleted file mode 100644
index da905e3f12..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif
deleted file mode 100644
index b9248dcf67..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif
deleted file mode 100644
index 3fd90cf828..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif
deleted file mode 100644
index 7145d6de8e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
deleted file mode 100644
index 390f48216a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif
deleted file mode 100644
index d1873a1a51..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
deleted file mode 100644
index 0ac0ee8635..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
deleted file mode 100644
index 704b484070..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
+++ /dev/null
@@ -1,45 +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
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - JAXB UI
-providerName=Eclipse Web Tools Platform
-
-jaxbPlatformUi = JAXB Platform UI
-
-jaxbWizardCategoryName = JAXB
-
-generateSchemaFromClassesName = Schema from JAXB Classes
-generateSchemaFromClassesDesc = Generate a Schema from JAXB classes
-
-generateClassesFromSchemaName = JAXB Classes from Schema
-generateClassesFromSchemaDesc = Generate JAXB Classes from a Schema
-
-newJaxbProjectWizardName = JAXB Project
-newJaxbProjectWizardDesc = Create a JAXB project
-
-jaxbCompletionProposals = JAXB Proposals
-jaxbCompletionProposalComputer = JAXB Proposal Computer
-
-jaxbNavigatorContent=JAXB Content
-generateJaxbClasses = JAXB Classes...
-
-jaxbNode = JAXB
-jaxbSchemas = Schemas
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
deleted file mode 100644
index eed93c7c17..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
+++ /dev/null
@@ -1,303 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?> <!--
- 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
- -->
-
-<plugin>
-
- <extension-point
- id="jaxbPlatformUis"
- name="%jaxbPlatformUi"
- schema="schema/jaxbPlatformUis.exsd"/>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.jaxb"
- name="%jaxbWizardCategoryName"/>
-
- <wizard
- id="org.eclipse.jpt.jaxb.ui.wizard.generateSchemaFromClasses"
- name="%generateSchemaFromClassesName"
- category="org.eclipse.jpt.jaxb"
- class="org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen.SchemaGeneratorWizard"
- icon="icons/full/etool16/NewXSD.gif">
- <description>%generateSchemaFromClassesDesc</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
-
- <wizard
- id="org.eclipse.jpt.jaxb.ui.wizard.generateJAXBClasses"
- name="%generateClassesFromSchemaName"
- category="org.eclipse.jpt.jaxb"
- class="org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard"
- icon="icons/full/etool16/newclass_wiz.gif">
- <description>%generateClassesFromSchemaDesc</description>
- </wizard>
-
- <!-- will need to specify a final perspective once we have a jaxb perspective -->
- <wizard
- id="org.eclipse.jpt.jaxb.ui.wizard.newJaxbProject"
- name="%newJaxbProjectWizardName"
- icon="icons/full/etool16/new_jaxb_project_wiz.gif"
- category="org.eclipse.jpt.jaxb"
- project="true">
- <description>%newJaxbProjectWizardDesc</description>
- <class class="org.eclipse.jpt.jaxb.ui.internal.wizards.proj.JaxbProjectWizard">
- <parameter name="menuIndex" value="35"/>
- </class>
- </wizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="jaxbCompletionProposals"
- name="%jaxbCompletionProposals">
-
- <proposalCategory icon="icons/full/etool16/jaxb_facet.gif"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="jaxbCompletionProposalComputer"
- name="%jaxbCompletionProposalComputer">
-
- <javaCompletionProposalComputer
- class="org.eclipse.jpt.jaxb.ui.internal.JaxbJavaCompletionProposalComputer"
- categoryId="org.eclipse.jpt.jaxb.ui.jaxbCompletionProposals"
- activate="true">
- <partition type="__dftl_partition_content_type"/>
- <partition type="__java_string"/>
- </javaCompletionProposalComputer>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.jaxb.ui.jaxbPlatformUis">
-
- <jaxbPlatformUi
- id="generic_2_1.ui"
- jaxbPlatform="generic_2_1"
- class="org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_PlatformUi"/>
-
- <jaxbPlatformUi
- id="generic_2_2.ui"
- jaxbPlatform="generic_2_2"
- class="org.eclipse.jpt.jaxb.ui.internal.jaxb22.GenericJaxb_2_2_PlatformUi"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.ui.libraryProviderActionPanels">
-
- <panel
- provider="jaxb-jre-library-provider"
- class="org.eclipse.jst.common.project.facet.ui.libprov.SimpleMessageLibraryProviderInstallPanel"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
-
- <navigatorContent
- id="org.eclipse.jpt.jaxb.ui.jaxbNavigatorContent"
- name="%jaxbNavigatorContent"
- priority="higher"
- appearsBefore="org.eclipse.jst.servlet.ui.EnhancedJavaRendering"
- icon="icons/full/obj16/jaxb_content.gif"
- activeByDefault="true"
- contentProvider="org.eclipse.jpt.jaxb.ui.internal.navigator.JaxbNavigatorContentProvider"
- labelProvider="org.eclipse.jpt.jaxb.ui.internal.navigator.JaxbNavigatorLabelProvider">
-
- <triggerPoints>
- <or>
- <instanceof
- value="org.eclipse.jpt.jaxb.core.context.JaxbContextNode"/>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" />
- </adapt>
- </and>
- </or>
- </triggerPoints>x
-
- <possibleChildren>
- <instanceof
- value="org.eclipse.jpt.jaxb.core.context.JaxbContextNode"/>
- </possibleChildren>
-
- <!--
- <actionProvider
- class="org.eclipse.jpt.jpa.ui.internal.navigator.JpaNavigatorActionProvider"
- id="org.eclipse.jpt.jpa.ui.jpaActionProvider">
- <enablement>
- <and>
- <instanceof
- value="org.eclipse.jpt.jpa.core.context.JpaContextNode"/>
- </and>
- </enablement>
- </actionProvider>
- -->
-
- <!--
- <commonSorter
- id="org.eclipse.jst.j2ee.navigator.internal.J2EEViewerSorter"
- class="org.eclipse.jst.j2ee.navigator.internal.J2EEViewerSorter" />
- -->
-
- </navigatorContent>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.viewer">
-
- <viewerContentBinding
- viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.eclipse.jpt.jaxb.ui.*"/>
- </includes>
- </viewerContentBinding>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <!-- contributions to the "Generate" submenu -->
- <objectContribution
- id="org.eclipse.jpt.jpa.ui.xsdFileActions"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xsd">
- <filter
- name="projectNature"
- value="org.eclipse.jdt.core.javanature">
- </filter>
- <action
- id="org.eclipse.jpt.jaxb.ui.generateJaxbClasses"
- label="%generateJaxbClasses"
- menubarPath="generateMenuId/GenerateXML"
- class="org.eclipse.jpt.jaxb.ui.internal.actions.GenerateClassesAction">
- </action>
- </objectContribution>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.preferencePages">
-
- <!-- no actual preferences yet
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbPreferences"
- category="org.eclipse.jpt.jpa.ui.preferences"
- class="org.eclipse.jpt.jaxb.ui.internal.preferences.JaxbPreferencesPage"
- name="%jaxbNode"/>
- -->
-
- <!--
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbProblemSeveritiesPreferences"
- category="org.eclipse.jpt.jaxb.ui.jaxbPreferences"
- class="org.eclipse.jpt.jaxb.ui.internal.preferences.JaxbProblemSeveritiesPage"
- name="%jaxbProblemSeveritiesNode">
- </page>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.propertyPages">
-
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbProjectProperties"
- name="%jaxbNode"
- class="org.eclipse.jpt.jaxb.ui.internal.properties.JaxbProjectPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- </enabledWhen>
- </page>
-
- <page
- id="org.eclipse.jpt.jaxb.ui.jaxbSchemasProperties"
- name="%jaxbSchemas"
- category="org.eclipse.jpt.jaxb.ui.jaxbProjectProperties"
- class="org.eclipse.jpt.jaxb.ui.internal.properties.JaxbSchemasPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- </enabledWhen>
- </page>
-
- <!--
- <page
- id="org.eclipse.jpt.jpa.ui.jaxbProblemSeveritiesProperties"
- name="%jaxbProblemSeveritiesNode"
- category="org.eclipse.jpt.jaxb.ui.jaxbProjectProperties"
- class="org.eclipse.jpt.jaxb.ui.internal.preferences.JaxbProblemSeveritiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- </enabledWhen>
- </page>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.images">
-
- <image facet="jpt.jaxb" path="icons/full/etool16/jaxb_facet.gif"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.wizardPages">
-
- <wizard-pages action="jpt.jaxb.install">
- <page class="org.eclipse.jpt.jaxb.ui.internal.wizards.facet.JaxbFacetInstallPage"/>
- </wizard-pages>
-
- <wizard-pages action="jpt.jaxb.version-change">
- <page class="org.eclipse.jpt.jaxb.ui.internal.wizards.facet.JaxbFacetVersionChangePage"/>
- </wizard-pages>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
deleted file mode 100644
index 73b7773f0c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
+++ /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
-################################################################################
-
-JavaProjectWizardPage_project = Project:
-JavaProjectWizardPage_destinationProject = Select destination project:
-
-# ClassesGenerator
-ClassesGeneratorProjectWizardPage_title = Java Project
-ClassesGeneratorProjectWizardPage_desc = Specify project for the new classes.
-
-ClassesGeneratorWizard_title = New JAXB Classes from schema
-
-ClassesGeneratorWizard_errorDialogTitle = Generate Classes Failed
-ClassesGeneratorWizard_couldNotCreate = Could not create {0}
-
-JaxbContent_label=JAXB Content
-
-SchemasPage_description = Configure JAXB schemas used for validation and user-assist
-SchemasPage_revert = &Revert
-SchemasPage_schemas = &Schema namespaces and locations:
-SchemasPage_namespaceColumnLabel = Namespace
-SchemasPage_locationColumnLabel = Location
-SchemasPage_addButtonLabel = &Add ...
-SchemasPage_editButtonLabel = &Edit ...
-SchemasPage_removeButtonLabel = Re&move
-SchemasPage_addSchemaMessage = Enter a new schema namespace and the location where it can be found.
-SchemasPage_editSchemaMessage = Edit an existing schema namespace and the location where it can be found.
-SchemasPage_addSchemaDialogTitle = Add Schema Location
-SchemasPage_editSchemaDialogTitle = Edit Schema Location
-SchemasPage_addSchemaTitle = Add a new schema location
-SchemasPage_editSchemaTitle = Edit an existing schema location
-SchemasPage_locationLabel = &Location:
-SchemasPage_browseButtonLabel = &Browse ...
-SchemasPage_namespaceLabel = &Namespace:
-SchemasPage_noNamespaceText = <no namespace>
-SchemasPage_schemaUnresolvedMessage = Could not resolve chosen schema location.
-SchemasPage_duplicateNamespaceMessage = That namespace is already in use.
-SchemasPage_noLocationMessage = You must specify a location.
-SchemasPage_chooseLocationTitle = Select Schema Location
-
-SchemaWizardPage_title = Select Schema
-SchemaWizardPage_desc = Specify schema to generate the classes from
-
-SchemaWizardPage_xmlCatalogTableTitle = XML Catalog
-SchemaWizardPage_xmlCatalogKeyColumn = Key
-SchemaWizardPage_xmlCatalogUriColumn = URI
-
-SchemaWizardPage_errorUriCannotBeLocated = The selected catalog entry specifies a URI that can not be located.
-
-ClassesGeneratorWizardPage_title = Generate Classes from Schema: {0}
-ClassesGeneratorWizardPage_desc = Configure JAXB class generation.
-
-ClassesGeneratorWizardPage_usesMoxyImplementation = Use EclipseLink MOXy as the JAXB implementation
-
-ClassesGeneratorWizardPage_catalog = Catalog:
-ClassesGeneratorWizardPage_bindingsFiles = Bindings files:
-ClassesGeneratorWizardPage_browseButton = Browse...
-ClassesGeneratorWizardPage_addButton = Add...
-ClassesGeneratorWizardPage_removeButton = Remove
-ClassesGeneratorWizardPage_chooseABindingsFile = External Bindings File Selection
-ClassesGeneratorWizardPage_chooseACatalog = Catalog File Selection
-
-ClassesGeneratorWizardPage_sourceFolderSelectionDialog_title = Source Folder Selection
-ClassesGeneratorWizardPage_chooseSourceFolderDialog_desc = &Choose a source folder:
-
-ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with class generation.\
- \nPlease insure that a JAXB implementation is available on the classpath.
-
-ClassesGeneratorWizardPage_moxyLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with class generation.\
- \nPlease insure that EclipseLink MOXy is available on the classpath.
-
-ClassesGeneratorOptionsWizardPage_title = Classes Generator Options
-ClassesGeneratorOptionsWizardPage_desc = Configure JAXB compiler options.
-
-ClassesGeneratorOptionsWizardPage_proxyGroup = Proxy
-ClassesGeneratorOptionsWizardPage_noProxy = No proxy
-ClassesGeneratorOptionsWizardPage_proxy = Proxy:
-ClassesGeneratorOptionsWizardPage_proxyFile = Proxy file:
-ClassesGeneratorOptionsWizardPage_chooseAProxyFile = Proxy File Selection
-
-ClassesGeneratorOptionsWizardPage_useStrictValidation = Use strict validation
-ClassesGeneratorOptionsWizardPage_makeReadOnly = Generate read-only files
-ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen = Suppress package-info generation
-ClassesGeneratorOptionsWizardPage_suppressesHeaderGen = Suppress generation of file header
-ClassesGeneratorOptionsWizardPage_target = Target XJC 2.0
-ClassesGeneratorOptionsWizardPage_verbose = Verbose
-ClassesGeneratorOptionsWizardPage_quiet = Suppress compiler output
-
-ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema = Treat input as XML schema
-ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg = Treat input as RELAX NG
-ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact = Treat input as RELAX NG compact syntax
-ClassesGeneratorOptionsWizardPage_treatsAsDtd = Treat input as XML DTD
-ClassesGeneratorOptionsWizardPage_treatsAsWsdl = Treat input as WSDL and compile schema inside it
-ClassesGeneratorOptionsWizardPage_showsVersion = Show version
-ClassesGeneratorOptionsWizardPage_showsHelp = Show help
-
-ClassesGeneratorExtensionOptionsWizardPage_title = Classes Generator Extension Configuration
-ClassesGeneratorExtensionOptionsWizardPage_desc = Configure JAXB compiler vendor extensions.
-
-ClassesGeneratorExtensionOptionsWizardPage_allowExtensions = Allow vendor extensions
-ClassesGeneratorExtensionOptionsWizardPage_classpath = Classpath:
-ClassesGeneratorExtensionOptionsWizardPage_additionalArguments = Additional arguments:
-
-ClassesGeneratorUi_generatingEntities = Generating JAXB Classes from Schema
-ClassesGeneratorUi_generatingEntitiesTask = Generating classes
-
-ClassesGeneratorUi_generatingClassesWarningTitle = Generating JAXB Classes
-ClassesGeneratorUi_generatingClassesWarningMessage = \
- Warning: Generating classes will overwrite existing files in your project.\
- \n\nAre you sure you want to continue?
-
-# SchemaGenerator
-SchemaGeneratorWizard_title = New JAXB Schema File
-
-SchemaGeneratorWizard_generatingSchema = Generating JAXB Schema
-
-SchemaGeneratorProjectWizardPage_title = JAXB schema file
-SchemaGeneratorProjectWizardPage_desc = Specify default file name and location
-
-SchemaGeneratorWizardPage_title = Generate Schema from Classes
-SchemaGeneratorWizardPage_desc = Select classes to include.
-
-SchemaGeneratorWizardPage_shemaLocation = Schema file:
-SchemaGeneratorWizardPage_shema = Schema name:
-SchemaGeneratorWizardPage_packages = Select classes to include in schema:
-SchemaGeneratorWizardPage_browse = Browse...
-
-SchemaGeneratorWizardPage_chooseSchemaDialogTitle = Select Schema File
-
-SchemaGeneratorWizardPage_errorNoSchema = Schema name cannot be empty
-SchemaGeneratorWizardPage_errorNoPackage = No classes included
-
-SchemaGeneratorWizardPage_jaxbLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with schema generation.\
- \nPlease insure that a JAXB implementation is available on the classpath.
-
-SchemaGeneratorWizardPage_moxyLibrariesNotAvailable = \
- The classpath for this project does not appear to contain the necessary libraries to proceed with schema generation.\
- \nPlease insure that EclipseLink MOXy is available on the classpath.
-
-SchemaGeneratorWizard_generateSchemaTask = Generating schema {0}
-
-#NewSchemaFileWizardPage
-
-NewSchemaFileWizardPage_errorNotJavaProject = Not a Java project
-NewSchemaFileWizardPage_overwriteExistingSchemas = Schema generation may overwrite existing schemas in the specified directory.
-
-
-JaxbProjectWizard_title = New JAXB Project
-
-JaxbProjectWizard_firstPage_title = JAXB Project
-JaxbProjectWizard_firstPage_desc = Configure JAXB project settings.
-
-JaxbFacetWizardPage_title = JAXB Facet
-JaxbFacetWizardPage_desc = Configure JAXB settings.
-JaxbFacetWizardPage_platformLabel = &Platform
-JaxbFacetWizardPage_facetsPageLink = <a>Change JAXB version ...</a>
-JaxbFacetWizardPage_jaxbImplementationLabel = JAXB implementation
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd
deleted file mode 100644
index dc152bc93b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/schema/jaxbPlatformUis.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.jaxb.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.jaxb.ui" id="jpaPlatforms" name="JAXB Platform UIs"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="jaxbPlatformUi" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <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="jaxbPlatformUi">
- <annotation>
- <documentation>
- Extenders of the org.eclipse.jpt.jaxb.core.jaxbPlatforms extension point may also use this point to insert UI into the workbench for that platform. The jaxbPlatform must match the id of a jaxbPlatform extension.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jaxbPlatform" type="string" use="required">
- <annotation>
- <documentation>
- The jaxbPlatform must match a corresponding org.eclipse.jpt.jaxb.core.jaxbPlatform extension id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The instantiable class that implements &lt;samp&gt;org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- 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>
- [Enter information about supplied implementation of this extension point.]
- </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.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
deleted file mode 100644
index 824a4d7507..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
+++ /dev/null
@@ -1,117 +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.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jpt.jaxb.ui.internal.platform.JaxbPlatformUiManagerImpl;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * 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.
- */
-@SuppressWarnings("nls")
-public class JptJaxbUiPlugin extends AbstractUIPlugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.ui";
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- public static final String USER_CATALOG_ID = XMLCorePlugin.USER_CATALOG_ID; //$NON-NLS-1$
- public static final String DEFAULT_CATALOG_ID = XMLCorePlugin.DEFAULT_CATALOG_ID; //$NON-NLS-1$
- public static final String SYSTEM_CATALOG_ID = XMLCorePlugin.SYSTEM_CATALOG_ID; //$NON-NLS-1$
-
- // ********** singleton **********
- private static JptJaxbUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJaxbUiPlugin instance() {
- return INSTANCE;
- }
-
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- public static JaxbPlatformUiManager getJaxbPlatformUiManager() {
- return JaxbPlatformUiManagerImpl.instance();
- }
-
-
- // ********** XMLCorePlugin API **********
-
- public ICatalog getDefaultXMLCatalog() {
- return XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- }
-
- // ********** constructors **********
- public JptJaxbUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
deleted file mode 100644
index c6db6cfd70..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.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.ui.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.GenerateJaxbClassesJob;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * ClassesGeneratorUi
- */
-public class ClassesGeneratorUi {
- private final IJavaProject javaProject;
- private final String schemaPathOrUri;
-
- // ********** static methods **********
-
- public static void generate(IFile xsdFile) {
- IJavaProject javaProject = JavaCore.create(xsdFile.getProject());
- if (javaProject == null) {
- throw new NullPointerException();
- }
- IPath xmlSchema = xsdFile.getProjectRelativePath();
-
- new ClassesGeneratorUi(javaProject, xmlSchema.toOSString()).generate();
- }
-
- // ********** constructors **********
- private ClassesGeneratorUi(IJavaProject javaProject, String schemaPathOrUri) {
- super();
- if(javaProject == null || StringTools.stringIsEmpty(schemaPathOrUri)) {
- throw new NullPointerException();
- }
- this.javaProject = javaProject;
- this.schemaPathOrUri = schemaPathOrUri;
- }
-
- // ********** generate **********
- /**
- * prompt the user with a wizard
- */
- protected void generate() {
- ClassesGeneratorWizard wizard = new ClassesGeneratorWizard(this.javaProject, this.schemaPathOrUri);
- wizard.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode != Window.OK) {
- return;
- }
- String outputDir = wizard.getDestinationFolder();
- String targetPackage = wizard.getTargetPackage();
- String catalog = wizard.getCatalog();
- boolean usesMoxy = wizard.usesMoxy();
- String[] bindingsFileNames = wizard.getBindingsFileNames();
- ClassesGeneratorOptions generatorOptions = wizard.getGeneratorOptions();
- ClassesGeneratorExtensionOptions generatorExtensionOptions = wizard.getGeneratorExtensionOptions();
-
- if(this.displayOverridingClassesWarning(generatorOptions)) {
- this.generateJaxbClasses(outputDir, targetPackage, catalog, usesMoxy, bindingsFileNames, generatorOptions, generatorExtensionOptions);
- }
- }
-
- // ********** internal methods **********
-
- private void generateJaxbClasses(
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
-
- try {
- WorkspaceJob job = new GenerateJaxbClassesJob(
- this.javaProject,
- this.schemaPathOrUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions);
- job.schedule();
- }
- catch(RuntimeException re) {
- JptJaxbUiPlugin.log(re);
-
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
- this.logError(message);
- }
- }
-
- private void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorWizard_errorDialogTitle,
- message
- );
- }
-
- private Shell getShell() {
- Display display = Display.getCurrent();
- Shell shell = (display == null) ? null : display.getActiveShell();
- if(shell == null && display != null) {
- Shell[] shells = display.getShells();
- if(shells.length > 0)
- shell = shells[0];
- }
- return shell;
- }
-
- private boolean isOverridingClasses(ClassesGeneratorOptions generatorOptions) {
- if(generatorOptions == null) {
- throw new NullPointerException();
- }
- if(generatorOptions.showsVersion() || generatorOptions.showsHelp()) {
- return false;
- }
- return true;
- }
-
- private boolean displayOverridingClassesWarning(ClassesGeneratorOptions generatorOptions) {
-
- if( ! this.isOverridingClasses(generatorOptions)) {
- return true;
- }
- return MessageDialog.openQuestion(
- this.getCurrentShell(),
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningTitle,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningMessage);
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
deleted file mode 100644
index 9a8fb04f8e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.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.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.CompletionContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
-import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-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.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-
-
-public class JaxbJavaCompletionProposalComputer
- implements IJavaCompletionProposalComputer {
-
- public JaxbJavaCompletionProposalComputer() {
- super();
- }
-
-
- public void sessionStarted() {
- // do nothing
- }
-
- @SuppressWarnings("unchecked")
- public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return (context instanceof JavaContentAssistInvocationContext) ?
- computeCompletionProposals((JavaContentAssistInvocationContext) context)
- : Collections.emptyList();
- }
-
- /**
- * We fail silently here because (it seems) <em>expected</em> exceptions occur
- * more frequently than intermittent <em>unexpected</em> exceptions that might
- * merit investigation (and a logged stacktrace might be the only hint as
- * to what happened).
- * <p>
- * We will get an <em>expected</em> exception (typically a {@link NullPointerException NPE})
- * here if the user:<ol>
- * <li>modifies the Java source file in a way that puts it drastically out
- * of sync with the Dali context model (e.g. deleting a field or
- * annotation)
- * <li>immediately invokes Content Assist (typically <code>Ctrl+Space</code>)
- * </ol>
- * The AST we build here will be based on the just-modified Java source; but,
- * since the user moved quickly and we will not have yet received any Java
- * change notification (since we only get a Java change notification when
- * the user has paused typing for at least 0.5 seconds), the context model
- * will still be based on the unmodified Java source. As the new AST is
- * passed down through the context model to the resource model all the code
- * expects to find the AST in sync with the model. When this is not the
- * case (e.g. a field in the resource model is no longer present in the AST
- * because the user has deleted it or modified the code in such a way that
- * the parser can no longer detect the field) the model will probably choke
- * when it cannot find the corresponding AST node.
- * <p>
- * It seems reasonable, in these situations, to simply return no completion
- * proposals. If the user simply waits a moment and tries again, we will be
- * able to successfully calculate some proposals.
- * <p>
- * ~bjv
- */
- private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context) {
- try {
- return computeCompletionProposals_(context);
- }
- catch (Exception ex) {
- // JptJaxbCorePlugin.log(ex); // don't log "expected" exceptions (?)
- return Collections.emptyList();
- }
- }
-
- private List<ICompletionProposal> computeCompletionProposals_(JavaContentAssistInvocationContext context) {
- ICompilationUnit cu = context.getCompilationUnit();
- IFile file = (cu != null) ? getCorrespondingResource(cu) : null;
- IContentType contentType = (file != null) ? PlatformTools.getContentType(file) : null;
-
- if (contentType == null || ! contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return Collections.emptyList();
- }
-
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(file.getProject());
- if (jaxbProject == null) {
- return Collections.emptyList();
- }
-
- Iterable<? extends JavaContextNode> javaNodes = jaxbProject.getPrimaryJavaNodes(cu);
- if (CollectionTools.isEmpty(javaNodes)) {
- return Collections.emptyList();
- }
-
- CompletionContext cc = context.getCoreContext();
-
- // the context's "token" is really a sort of "prefix" - it does NOT
- // correspond to the "start" and "end" we get below...
- char[] prefix = cc.getToken();
- Filter<String> filter = ((prefix == null) ? Filter.Null.<String>instance() : new IgnoreCasePrefixFilter(prefix));
- // the token "start" is the offset of the token's first character
- int tokenStart = cc.getTokenStart();
- // the token "end" is the offset of the token's last character (yuk)
- int tokenEnd = cc.getTokenEnd();
- if (tokenStart == -1) { // not sure why this happens - see bug 242286
- return Collections.emptyList();
- }
-
-// System.out.println("prefix: " + ((prefix == null) ? "[null]" : new String(prefix)));
-// System.out.println("token start: " + tokenStart);
-// System.out.println("token end: " + tokenEnd);
-// String source = cu.getSource();
-// String token = source.substring(Math.max(0, tokenStart), Math.min(source.length(), tokenEnd + 1));
-// System.out.println("token: =>" + token + "<=");
-// String snippet = source.substring(Math.max(0, tokenStart - 20), Math.min(source.length(), tokenEnd + 21));
-// System.out.println("surrounding snippet: =>" + snippet + "<=");
-
- // TODO move this parser call into the model...
- CompilationUnit astRoot = ASTTools.buildASTRoot(cu);
- List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- for (JavaContextNode javaNode : javaNodes) {
- for (String proposal : javaNode.getJavaCompletionProposals(context.getInvocationOffset(), filter, astRoot)) {
- proposals.add(new CompletionProposal(proposal, tokenStart, tokenEnd - tokenStart + 1, proposal.length()));
- }
- }
- return proposals;
- }
-
- private IFile getCorrespondingResource(ICompilationUnit cu) {
- try {
- return (IFile) cu.getCorrespondingResource();
- } catch (JavaModelException ex) {
- JptJaxbUiPlugin.log(ex);
- return null;
- }
- }
-
- @SuppressWarnings("unchecked")
- public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return Collections.emptyList();
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- public void sessionEnded() {
- // do nothing
- }
-
- private static class IgnoreCasePrefixFilter implements Filter<String> {
- private final char[] prefix;
- IgnoreCasePrefixFilter(char[] prefix) {
- super();
- this.prefix = prefix;
- }
- public boolean accept(String s) {
- return StringTools.stringStartsWithIgnoreCase(s.toCharArray(), this.prefix);
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
deleted file mode 100644
index 12c75d47dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.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.ui.internal;
-
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.swt.graphics.Image;
-
-public class JaxbMappingImageHelper
-{
-//
-// public static Image imageForTypeMapping(String mappingKey) {
-// return JptUiPlugin.getImage(iconKeyForTypeMapping(mappingKey));
-// }
-//
-// public static String iconKeyForTypeMapping(String mappingKey) {
-// if (MappingKeys.NULL_TYPE_MAPPING_KEY == mappingKey) {
-// return JptUiIcons.NULL_TYPE_MAPPING;
-// }
-// else if (MappingKeys.ENTITY_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.ENTITY;
-// }
-// else if (MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.EMBEDDABLE;
-// }
-// else if (MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.MAPPED_SUPERCLASS;
-// }
-// return null;
-// }
-
- public static Image imageForAttributeMapping(String mappingKey) {
- return JptJaxbUiPlugin.getImage(iconKeyForAttributeMapping(mappingKey));
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
- if (MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbUiIcons.NULL_ATTRIBUTE_MAPPING;
- }
- else if (MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ANY_ATTRIBUTE;
- }
- else if (MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ANY_ELEMENT;
- }
- else if (MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ATTRIBUTE;
- }
- else if (MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT;
- }
- else if (MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_TRANSIENT;
- }
- else if (MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_VALUE;
- }
- //return the JAXB_CONTENT icon instead of null, might as well have an icon if one is not defined
- return JptJaxbUiIcons.JAXB_CONTENT;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
deleted file mode 100644
index 13cc8458a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
+++ /dev/null
@@ -1,46 +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.ui.internal;
-
-@SuppressWarnings("nls")
-public class JptJaxbUiIcons
-{
- // **************** General icons **************************************
-
- public static final String JAXB_CONTENT = "full/obj16/jaxb_content";
- public static final String PACKAGE = "full/obj16/package";
-
- public static final String PERSISTENT_CLASS = "full/obj16/persistent_class";
- public static final String PERSISTENT_ENUM = "full/obj16/persistent_enum";
- public static final String TRANSIENT_CLASS = "full/obj16/transient_class";
- public static final String REGISTRY = "full/obj16/registry";
-
- public static final String PERSISTENT_FIELD = "full/obj16/persistent_field";
- public static final String PERSISTENT_PROPERTY = "full/obj16/persistent_property";
- public static final String ENUM_CONSTANT = "full/obj16/enum_constant";
-
- public static final String SCHEMA_GEN = "full/wizban/NewXSD";
-
- // **************** Wizard icons *******************************************
-
- public static final String SCHEMA_GEN_WIZ_BANNER = "full/wizban/NewXSD";
- public static final String CLASSES_GEN_WIZ_BANNER = "full/wizban/newclass_wiz";
- public static final String JAXB_WIZ_BANNER = "full/wizban/new_jaxb_prj_wiz";
-
-
- public static final String XML_ANY_ATTRIBUTE = "full/obj16/xml-any-attribute";
- public static final String XML_ANY_ELEMENT = "full/obj16/xml-any-element";
- public static final String XML_ATTRIBUTE = "full/obj16/xml-attribute";
- public static final String XML_ELEMENT = "full/obj16/xml-element";
- public static final String XML_TRANSIENT = "full/obj16/xml-transient";
- public static final String XML_VALUE = "full/obj16/xml-value";
- public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
deleted file mode 100644
index 753b671958..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
+++ /dev/null
@@ -1,181 +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.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali JAXB UI.
- *
- * @version 2.3
- */
-public class JptJaxbUiMessages {
-
- public static String JavaProjectWizardPage_project;
- public static String JavaProjectWizardPage_destinationProject;
-
- // ClassesGenerator
- public static String ClassesGeneratorProjectWizardPage_title;
- public static String ClassesGeneratorProjectWizardPage_desc;
-
- public static String ClassesGeneratorWizard_title;
- public static String ClassesGeneratorWizard_errorDialogTitle;
- public static String ClassesGeneratorWizard_couldNotCreate;
-
- public static String JaxbContent_label;
-
- public static String SchemasPage_description;
- public static String SchemasPage_revert;
- public static String SchemasPage_schemas;
- public static String SchemasPage_namespaceColumnLabel;
- public static String SchemasPage_locationColumnLabel;
- public static String SchemasPage_addButtonLabel;
- public static String SchemasPage_editButtonLabel;
- public static String SchemasPage_removeButtonLabel;
- public static String SchemasPage_addSchemaMessage;
- public static String SchemasPage_editSchemaMessage;
- public static String SchemasPage_addSchemaDialogTitle;
- public static String SchemasPage_editSchemaDialogTitle;
- public static String SchemasPage_addSchemaTitle;
- public static String SchemasPage_editSchemaTitle;
- public static String SchemasPage_locationLabel;
- public static String SchemasPage_browseButtonLabel;
- public static String SchemasPage_namespaceLabel;
- public static String SchemasPage_noNamespaceText;
- public static String SchemasPage_schemaUnresolvedMessage;
- public static String SchemasPage_duplicateNamespaceMessage;
- public static String SchemasPage_noLocationMessage;
- public static String SchemasPage_chooseLocationTitle;
-
- public static String SchemaWizardPage_title;
- public static String SchemaWizardPage_desc;
-
- public static String SchemaWizardPage_xmlCatalogTableTitle;
- public static String SchemaWizardPage_xmlCatalogKeyColumn;
- public static String SchemaWizardPage_xmlCatalogUriColumn;
-
- public static String SchemaWizardPage_errorUriCannotBeLocated;
-
-
- public static String ClassesGeneratorWizardPage_title;
- public static String ClassesGeneratorWizardPage_desc;
-
- public static String ClassesGeneratorWizardPage_usesMoxyImplementation;
-
- public static String ClassesGeneratorWizardPage_catalog;
- public static String ClassesGeneratorWizardPage_bindingsFiles;
- public static String ClassesGeneratorWizardPage_browseButton;
- public static String ClassesGeneratorWizardPage_addButton;
- public static String ClassesGeneratorWizardPage_removeButton;
- public static String ClassesGeneratorWizardPage_chooseABindingsFile;
- public static String ClassesGeneratorWizardPage_chooseACatalog;
-
- public static String ClassesGeneratorWizardPage_sourceFolderSelectionDialog_title;
- public static String ClassesGeneratorWizardPage_chooseSourceFolderDialog_desc;
-
- public static String ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable;
- public static String ClassesGeneratorWizardPage_moxyLibrariesNotAvailable;
-
- public static String ClassesGeneratorOptionsWizardPage_title;
- public static String ClassesGeneratorOptionsWizardPage_desc;
-
- public static String ClassesGeneratorOptionsWizardPage_proxyGroup;
- public static String ClassesGeneratorOptionsWizardPage_noProxy;
- public static String ClassesGeneratorOptionsWizardPage_proxy;
- public static String ClassesGeneratorOptionsWizardPage_proxyFile;
- public static String ClassesGeneratorOptionsWizardPage_chooseAProxyFile;
-
- public static String ClassesGeneratorOptionsWizardPage_useStrictValidation;
- public static String ClassesGeneratorOptionsWizardPage_makeReadOnly;
- public static String ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen;
- public static String ClassesGeneratorOptionsWizardPage_suppressesHeaderGen;
- public static String ClassesGeneratorOptionsWizardPage_target;
- public static String ClassesGeneratorOptionsWizardPage_verbose;
- public static String ClassesGeneratorOptionsWizardPage_quiet;
-
- public static String ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsDtd;
- public static String ClassesGeneratorOptionsWizardPage_treatsAsWsdl;
- public static String ClassesGeneratorOptionsWizardPage_showsVersion;
- public static String ClassesGeneratorOptionsWizardPage_showsHelp;
-
- public static String ClassesGeneratorExtensionOptionsWizardPage_title;
- public static String ClassesGeneratorExtensionOptionsWizardPage_desc;
-
- public static String ClassesGeneratorExtensionOptionsWizardPage_allowExtensions;
- public static String ClassesGeneratorExtensionOptionsWizardPage_classpath;
- public static String ClassesGeneratorExtensionOptionsWizardPage_additionalArguments;
-
- public static String ClassesGeneratorUi_generatingEntities;
- public static String ClassesGeneratorUi_generatingEntitiesTask;
-
- public static String ClassesGeneratorUi_generatingClassesWarningTitle;
- public static String ClassesGeneratorUi_generatingClassesWarningMessage;
-
- // SchemaGenerator
- public static String SchemaGeneratorWizard_title;
- public static String SchemaGeneratorWizard_generatingSchema;
-
- public static String SchemaGeneratorProjectWizardPage_title;
- public static String SchemaGeneratorProjectWizardPage_desc;
-
- public static String SchemaGeneratorWizardPage_title;
- public static String SchemaGeneratorWizardPage_desc;
-
- public static String SchemaGeneratorWizardPage_shemaLocation;
- public static String SchemaGeneratorWizardPage_shema;
- public static String SchemaGeneratorWizardPage_packages;
- public static String SchemaGeneratorWizardPage_browse;
-
- public static String SchemaGeneratorWizardPage_chooseSchemaDialogTitle;
-
- public static String SchemaGeneratorWizardPage_errorNoSchema;
- public static String SchemaGeneratorWizardPage_errorNoPackage;
-
- public static String SchemaGeneratorWizardPage_jaxbLibrariesNotAvailable;
-
- public static String SchemaGeneratorWizardPage_moxyLibrariesNotAvailable;
-
- public static String SchemaGeneratorWizard_generateSchemaTask;
-
- public static String NewSchemaFileWizardPage_errorNotJavaProject;
- public static String NewSchemaFileWizardPage_overwriteExistingSchemas;
-
-
- // new project wizard
-
- public static String JaxbProjectWizard_title;
-
- public static String JaxbProjectWizard_firstPage_title;
- public static String JaxbProjectWizard_firstPage_desc;
-
-
- // facet page
-
- public static String JaxbFacetWizardPage_title;
- public static String JaxbFacetWizardPage_desc;
- public static String JaxbFacetWizardPage_platformLabel;
- public static String JaxbFacetWizardPage_facetsPageLink;
- public static String JaxbFacetWizardPage_jaxbImplementationLabel;
-
-
- private static final String BUNDLE_NAME = "jpt_jaxb_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJaxbUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptJaxbUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java
deleted file mode 100644
index 526fd69580..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.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.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.jaxb.ui.internal.ClassesGeneratorUi;
-
-/**
- * GenerateClassesAction
- */
-public class GenerateClassesAction extends ObjectAction
-{
-
- @Override
- protected void execute(IFile xsdFile) {
-
- ClassesGeneratorUi.generate(xsdFile);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java
deleted file mode 100644
index 652d75ac58..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.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.ui.internal.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * GenerateEntitiesAction
- */
-public abstract class ObjectAction extends ActionDelegate implements IObjectActionDelegate
-{
- private ISelection currentSelection;
-
- public ObjectAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- @Override
- public void run(IAction action) {
- if (this.currentSelection instanceof ITreeSelection) {
- for (Iterator<?> stream = ((ITreeSelection) this.currentSelection).iterator(); stream.hasNext(); ) {
- this.execute(stream.next());
- }
- }
- }
-
- protected void execute(Object selection) {
-
- if(selection instanceof IFile) {
- this.execute((IFile)selection);
- }
- }
-
- @SuppressWarnings("unused")
- protected void execute(IFile file) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java
deleted file mode 100644
index 5572e0b5fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java
+++ /dev/null
@@ -1,40 +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.ui.internal.filters;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * Filters out all containers i.e. all packages and folders
- */
-public class ContainerFilter extends ViewerFilter {
-
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean isContainer = element instanceof IContainer;
-
- if( ! isContainer && element instanceof IJavaElement) {
- int type= ((IJavaElement)element).getElementType();
- isContainer = (type == IJavaElement.JAVA_MODEL
- || type == IJavaElement.JAVA_PROJECT
- || type == IJavaElement.PACKAGE_FRAGMENT
- || type ==IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
- return ! isContainer;
- }
-
- @Override
- public String toString() {
- return "Filter out Containers"; //$NON-NLS-1$
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java
deleted file mode 100644
index e89609ec7a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.jdt.internal.ui.filters
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-
-
-/**
- * Filters empty non-leaf package fragments
- */
-public class EmptyInnerPackageFilter extends ViewerFilter {
-
- /*
- * @see ViewerFilter
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IPackageFragment) {
- IPackageFragment pkg= (IPackageFragment)element;
- try {
- if (pkg.isDefaultPackage())
- return pkg.hasChildren();
- return !pkg.hasSubpackages() || pkg.hasChildren() || (pkg.getNonJavaResources().length > 0);
- } catch (JavaModelException e) {
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java
deleted file mode 100644
index 9ae95f8b9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.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
-*
-* Code originate from XXXX
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * NonArchiveOrExternalElementFilter
- */
-public class NonArchiveOrExternalElementFilter extends ViewerFilter {
-
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- if(element instanceof IPackageFragmentRoot) {
- IPackageFragmentRoot root= (IPackageFragmentRoot) element;
- return !root.isArchive() && !root.isExternal();
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "Filter out: Non-Archive and Non-External"; //$NON-NLS-1$
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java
deleted file mode 100644
index 8fd6e6ac82..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.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.ui.internal.filters;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * Filters out all non Container and all JavaProject
- * with name not equals to the given projectName.
- */
-public class NonContainerFilter extends ViewerFilter
-{
- final private String projectName;
-
- public NonContainerFilter(String projectName) {
- this.projectName = projectName;
- }
-
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean isContainer = element instanceof IContainer;
- int type;
- if( ! isContainer && element instanceof IJavaElement) {
- type = ((IJavaElement)element).getElementType();
- isContainer = (type == IJavaElement.JAVA_MODEL
- || type == IJavaElement.JAVA_PROJECT
- || type == IJavaElement.PACKAGE_FRAGMENT
- || type ==IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
- if(isContainer && (element instanceof IJavaElement)) {
- type = ((IJavaElement)element).getElementType();
- if(type == IJavaElement.JAVA_PROJECT) {
- String projectName = ((IJavaProject)element).getElementName();
- return projectName.equals(this.projectName);
- }
- }
- return isContainer;
- }
-
- @Override
- public String toString() {
- return "Filter out Non-Containers"; //$NON-NLS-1$
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
deleted file mode 100644
index 0c1a6949bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.jdt.internal.ui.filters
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.filters;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IStorage;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-import org.eclipse.jdt.core.IJavaElement;
-
-
-/**
- * Filters out all non-Java elements, and elements named package-info
- */
-public class NonJavaElementFilter extends ViewerFilter {
-
- static public String FILE_TO_EXCLUDE = "package-info.java"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IJavaElement) {
- return(FILE_TO_EXCLUDE.equals(((IJavaElement)element).getElementName())) ?
- false : true;
- }
-
- if (element instanceof IResource) {
- IProject project= ((IResource)element).getProject();
- return project == null || !project.isOpen();
- }
-
- // Exclude all IStorage elements which are neither Java elements nor resources
- if (element instanceof IStorage)
- return false;
-
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 7734572337..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,78 +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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass;
-
-
-public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
- implements ItemLabelProviderFactory {
-
- private static GenericJaxb_2_1_NavigatorItemLabelProviderFactory INSTANCE;
-
-
- public static GenericJaxb_2_1_NavigatorItemLabelProviderFactory instance() {
- if (INSTANCE == null) {
- INSTANCE = new GenericJaxb_2_1_NavigatorItemLabelProviderFactory();
- }
- return INSTANCE;
- }
-
-
- private GenericJaxb_2_1_NavigatorItemLabelProviderFactory() {
- super();
- }
-
-
- public ItemLabelProvider buildItemLabelProvider(
- Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider) {
-
- if (item instanceof JaxbContextRoot) {
- return new JaxbContextRootItemLabelProvider((JaxbContextRoot) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPackage) {
- return new JaxbPackageItemLabelProvider((JaxbPackage) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbRegistry) {
- return new JaxbRegistryItemLabelProvider((JaxbRegistry) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentClass) {
- return new JaxbPersistentClassItemLabelProvider((JaxbPersistentClass) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentEnum) {
- return new JaxbPersistentEnumItemLabelProvider((JaxbPersistentEnum) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbTransientClass) {
- return new JaxbTransientClassItemLabelProvider((JaxbTransientClass) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentField) {
- return new JaxbPersistentFieldItemLabelProvider((JaxbPersistentField) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentProperty) {
- return new JaxbPersistentPropertyItemLabelProvider((JaxbPersistentProperty) item, contentAndLabelProvider);
- }
- else if (item instanceof JaxbEnumConstant) {
- return new JaxbEnumConstantItemLabelProvider((JaxbEnumConstant) item, contentAndLabelProvider);
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java
deleted file mode 100644
index 2b053849fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-
-
-public class GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory {
-
- private static GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory INSTANCE;
-
-
- public static GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory instance() {
- if (INSTANCE == null) {
- INSTANCE = new GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory();
- }
- return INSTANCE;
- }
-
-
- private GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory() {
- super();
- }
-
-
- public TreeItemContentProvider buildItemContentProvider(
- Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider) {
-
- DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider =
- (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider;
-
- if (item instanceof JaxbContextRoot) {
- return new JaxbContextRootItemContentProvider((JaxbContextRoot) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbPackage) {
- return new JaxbPackageItemContentProvider((JaxbPackage) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentClass) {
- return new JaxbPersistentClassItemContentProvider((JaxbPersistentClass) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbPersistentEnum) {
- return new JaxbPersistentEnumItemContentProvider((JaxbPersistentEnum) item, treeContentAndLabelProvider);
- }
- else if (item instanceof JaxbRegistry) {
- return new JaxbRegistryItemContentProvider((JaxbRegistry) item, treeContentAndLabelProvider);
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.java
deleted file mode 100644
index 10da002510..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorUi.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-
-
-public class GenericJaxb_2_1_NavigatorUi
- implements JaxbNavigatorUi {
-
- private static GenericJaxb_2_1_NavigatorUi INSTANCE;
-
-
- public static GenericJaxb_2_1_NavigatorUi instance() {
- if (INSTANCE == null) {
- INSTANCE = new GenericJaxb_2_1_NavigatorUi();
- }
- return INSTANCE;
- }
-
-
- private GenericJaxb_2_1_NavigatorUi() {
- super();
- }
-
-
- public TreeItemContentProviderFactory getTreeItemContentProviderFactory() {
- return GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.instance();
- }
-
- public ItemLabelProviderFactory getItemLabelProviderFactory() {
- return GenericJaxb_2_1_NavigatorItemLabelProviderFactory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.java
deleted file mode 100644
index 9336abc359..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_PlatformUi.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class GenericJaxb_2_1_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return GenericJaxb_2_1_NavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java
deleted file mode 100644
index 4f6a013de8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java
+++ /dev/null
@@ -1,52 +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.ui.internal.jaxb21;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class JaxbContextRootItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbPackage> {
-
- public JaxbContextRootItemContentProvider(
- JaxbContextRoot rootContext, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(rootContext, contentProvider);
- }
-
-
- @Override
- public JaxbContextRoot getModel() {
- return (JaxbContextRoot) super.getModel();
- }
-
- @Override
- public IProject getParent() {
- return getModel().getJaxbProject().getProject();
- }
-
- @Override
- protected CollectionValueModel<JaxbPackage> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbContextRoot, JaxbPackage>(
- JaxbContextRoot.PACKAGES_COLLECTION,
- getModel()) {
-
- @Override
- protected Iterable<JaxbPackage> getIterable() {
- return this.subject.getPackages();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.java
deleted file mode 100644
index 1fa5c4e31d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbContextRootItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbContextRootItemLabelProvider(
- JaxbContextRoot rootContextNode, DelegatingContentAndLabelProvider labelProvider) {
-
- super(rootContextNode, labelProvider);
- }
-
-
- @Override
- public JaxbContextRoot getModel() {
- return (JaxbContextRoot) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CONTENT));
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(JptJaxbUiMessages.JaxbContent_label);
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- StringBuilder sb = new StringBuilder();
- sb.append(JptJaxbUiMessages.JaxbContent_label);
- sb.append(" - "); //$NON-NLS-1$
- sb.append(getModel().getResource().getFullPath().makeRelative());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.java
deleted file mode 100644
index 0a839f0d08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumConstantItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbEnumConstantItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbEnumConstantItemLabelProvider(
- JaxbEnumConstant jaxbEnumConstant, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbEnumConstant, labelProvider);
- }
-
-
- @Override
- public JaxbEnumConstant getModel() {
- return (JaxbEnumConstant) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.ENUM_CONSTANT));
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java
deleted file mode 100644
index 620c6e783e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-
-
-public class JaxbPackageItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbType> {
-
- public JaxbPackageItemContentProvider(
- JaxbPackage jaxbPackage, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbPackage, contentProvider);
- }
-
-
- @Override
- public JaxbPackage getModel() {
- return (JaxbPackage) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbType> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbContextRoot, JaxbType>(
- JaxbContextRoot.TYPES_COLLECTION, getParent()) {
- @Override
- protected Iterable<JaxbType> getIterable() {
- return this.subject.getTypes(getModel());
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.java
deleted file mode 100644
index a275cb7634..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbPackageItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbPackageItemLabelProvider(
- JaxbPackage jaxbPackage, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbPackage, labelProvider);
- }
-
- @Override
- public JaxbPackage getModel() {
- return (JaxbPackage) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PACKAGE));
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- StringBuilder sb = new StringBuilder();
- sb.append(getModel().getName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(getModel().getResource().getFullPath().makeRelative());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
deleted file mode 100644
index efe5f0f7d7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-
-public abstract class JaxbPersistentAttributeItemLabelProvider
- extends AbstractItemLabelProvider {
-
- public JaxbPersistentAttributeItemLabelProvider(
- JaxbPersistentAttribute attribute, DelegatingContentAndLabelProvider labelProvider) {
-
- super(attribute, labelProvider);
- }
-
-
- @Override
- public JaxbPersistentAttribute getModel() {
- return (JaxbPersistentAttribute) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<JaxbPersistentAttribute, Image>(
- new String[] {JaxbPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY, JaxbPersistentAttribute.MAPPING_PROPERTY},
- getModel()) {
- @Override
- protected Image buildValue_() {
- return JaxbMappingImageHelper.imageForAttributeMapping(this.subject.getMappingKey());
- }
- };
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- StringBuffer sb = new StringBuffer();
- if (getModel().isInherited()) {
- sb.append(getModel().getInheritedJavaResourceAttributeOwningTypeName());
- sb.append('.');
- }
- sb.append(getModel().getName());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return new StaticPropertyValueModel<String>(getModel().getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.java
deleted file mode 100644
index dfcf97e383..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemContentProvider.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.ui.internal.jaxb21;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-
-
-public class JaxbPersistentClassItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbPersistentAttribute> {
-
- public JaxbPersistentClassItemContentProvider(
- JaxbPersistentClass jaxbPersistentClass, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbPersistentClass, contentProvider);
- }
-
-
- @Override
- public JaxbPersistentClass getModel() {
- return (JaxbPersistentClass) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbPersistentAttribute> buildChildrenModel() {
- List<CollectionValueModel<JaxbPersistentAttribute>> list = new ArrayList<CollectionValueModel<JaxbPersistentAttribute>>();
- list.add(buildAttributesModel());
- list.add(buildInheritedAttributesModel());
- return new CompositeCollectionValueModel<CollectionValueModel<JaxbPersistentAttribute>, JaxbPersistentAttribute>(list);
- }
-
- protected CollectionValueModel<JaxbPersistentAttribute> buildAttributesModel() {
- return new CollectionAspectAdapter<JaxbPersistentClass, JaxbPersistentAttribute>(
- JaxbPersistentClass.ATTRIBUTES_COLLECTION, getModel()) {
- @Override
- protected Iterable<JaxbPersistentAttribute> getIterable() {
- return this.subject.getAttributes();
- }
- };
- }
-
- protected CollectionValueModel<JaxbPersistentAttribute> buildInheritedAttributesModel() {
- return new CollectionAspectAdapter<JaxbPersistentClass, JaxbPersistentAttribute>(
- JaxbPersistentClass.INHERITED_ATTRIBUTES_COLLECTION, getModel()) {
- @Override
- protected Iterable<JaxbPersistentAttribute> getIterable() {
- return this.subject.getInheritedAttributes();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemLabelProvider.java
deleted file mode 100644
index d13e1c3664..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentClassItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbPersistentClassItemLabelProvider
- extends JaxbTypeItemLabelProvider {
-
- public JaxbPersistentClassItemLabelProvider(
- JaxbPersistentClass jaxbPersistentClass, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbPersistentClass, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PERSISTENT_CLASS));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.java
deleted file mode 100644
index 5e7620866e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemContentProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-
-
-public class JaxbPersistentEnumItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbEnumConstant> {
-
- public JaxbPersistentEnumItemContentProvider(
- JaxbPersistentEnum jaxbPersistentEnum, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbPersistentEnum, contentProvider);
- }
-
-
- @Override
- public JaxbPersistentEnum getModel() {
- return (JaxbPersistentEnum) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbEnumConstant> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbPersistentEnum, JaxbEnumConstant>(
- JaxbPersistentEnum.ENUM_CONSTANTS_COLLECTION, getModel()) {
- @Override
- protected Iterable<JaxbEnumConstant> getIterable() {
- return this.subject.getEnumConstants();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.java
deleted file mode 100644
index 36e6c40455..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentEnumItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbPersistentEnumItemLabelProvider
- extends JaxbTypeItemLabelProvider {
-
- public JaxbPersistentEnumItemLabelProvider(
- JaxbPersistentEnum jaxbEnum, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbEnum, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PERSISTENT_ENUM));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.java
deleted file mode 100644
index d35c840617..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentFieldItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentField;
-
-
-public class JaxbPersistentFieldItemLabelProvider
- extends JaxbPersistentAttributeItemLabelProvider {
-
- public JaxbPersistentFieldItemLabelProvider(
- JaxbPersistentField jaxbField, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbField, labelProvider);
- }
-
-
- @Override
- public JaxbPersistentField getModel() {
- return (JaxbPersistentField) super.getModel();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java
deleted file mode 100644
index 18702e53d1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentPropertyItemLabelProvider.java
+++ /dev/null
@@ -1,30 +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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentProperty;
-
-
-public class JaxbPersistentPropertyItemLabelProvider
- extends JaxbPersistentAttributeItemLabelProvider {
-
- public JaxbPersistentPropertyItemLabelProvider(
- JaxbPersistentProperty jaxbProperty, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbProperty, labelProvider);
- }
-
-
- @Override
- public JaxbPersistentProperty getModel() {
- return (JaxbPersistentProperty) super.getModel();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java
deleted file mode 100644
index 940db5e8c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemContentProvider.java
+++ /dev/null
@@ -1,39 +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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-
-
-public class JaxbRegistryItemContentProvider
- extends AbstractTreeItemContentProvider<JaxbElementFactoryMethod> {
-
- public JaxbRegistryItemContentProvider(
- JaxbRegistry jaxbRegistry, DelegatingTreeContentAndLabelProvider contentProvider) {
-
- super(jaxbRegistry, contentProvider);
- }
-
-
- @Override
- public JaxbRegistry getModel() {
- return (JaxbRegistry) super.getModel();
- }
-
- @Override
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) getModel().getParent();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemLabelProvider.java
deleted file mode 100644
index 4d897515e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbRegistryItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbRegistry;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbRegistryItemLabelProvider
- extends JaxbTypeItemLabelProvider {
-
- public JaxbRegistryItemLabelProvider(
- JaxbRegistry jaxbRegistry, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbRegistry, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.REGISTRY));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTransientClassItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTransientClassItemLabelProvider.java
deleted file mode 100644
index 5f79b33805..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTransientClassItemLabelProvider.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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbTransientClassItemLabelProvider
- extends JaxbTypeItemLabelProvider {
-
- public JaxbTransientClassItemLabelProvider(
- JaxbTransientClass jaxbTransientType, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbTransientType, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptJaxbUiPlugin.getImage(JptJaxbUiIcons.TRANSIENT_CLASS));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
deleted file mode 100644
index c97eb44550..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
+++ /dev/null
@@ -1,46 +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.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-
-
-public abstract class JaxbTypeItemLabelProvider
- extends AbstractItemLabelProvider {
-
- protected JaxbTypeItemLabelProvider(
- JaxbType jaxbType, DelegatingContentAndLabelProvider labelProvider) {
-
- super(jaxbType, labelProvider);
- }
-
- @Override
- public JaxbType getModel() {
- return (JaxbType) super.getModel();
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(getModel().getTypeQualifiedName());
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- StringBuilder sb = new StringBuilder();
- sb.append(getModel().getFullyQualifiedName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(getModel().getResource().getFullPath().makeRelative());
- return new StaticPropertyValueModel<String>(sb.toString());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.java
deleted file mode 100644
index 3e2ad5efd9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb22/GenericJaxb_2_2_PlatformUi.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.ui.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class GenericJaxb_2_2_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return GenericJaxb_2_1_NavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java
deleted file mode 100644
index c4844b218a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentAndLabelProvider.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.ui.internal.navigator;
-
-import org.eclipse.jpt.common.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-
-
-public class JaxbNavigatorContentAndLabelProvider
- extends DelegatingTreeContentAndLabelProvider {
-
- public JaxbNavigatorContentAndLabelProvider() {
- super(new JaxbNavigatorTreeItemContentProviderFactory(), new JaxbNavigatorItemLabelProviderFactory());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
deleted file mode 100644
index e23922e219..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.ui.internal.navigator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-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.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.common.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * This extension of navigator content provider delegates to the platform UI
- * (see the org.eclipse.jpt.jaxb.ui.jaxbPlatformUis extension point) for navigator content.
- *
- * If there is a platform UI for the given project, this content provider will
- * provide a root "JAXB Content" node (child of the project), otherwise there
- * will be no content. For children of the "JAXB Content" node (or for any other
- * sub-node), this provider will delegate to the content provider returned by the
- * platform UI implementation.
- */
-public class JaxbNavigatorContentProvider
- implements ICommonContentProvider {
-
- private JaxbNavigatorContentAndLabelProvider delegate;
-
- private final CollectionChangeListener jaxbProjectListener;
-
- private StructuredViewer viewer;
-
-
- public JaxbNavigatorContentProvider() {
- super();
- this.jaxbProjectListener = this.buildJaxbProjectListener();
- JptJaxbCorePlugin.getProjectManager().addCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
- }
-
- protected CollectionChangeListener buildJaxbProjectListener() {
- return new JaxbProjectListener();
- }
-
- public JaxbNavigatorContentAndLabelProvider getDelegate() {
- return this.delegate;
- }
-
-
- // **************** IContentProvider implementation ************************
-
- public void dispose() {
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
- if (this.delegate != null) {
- this.delegate.dispose();
- }
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (this.delegate != null) {
- this.delegate.inputChanged(viewer, oldInput, newInput);
- }
- this.viewer = (StructuredViewer) viewer;
- }
-
-
- // **************** IStructuredContentProvider implementation **************
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
-
- // **************** ITreeContentProvider implementation ********************
-
- public Object getParent(Object element) {
- if (this.delegate != null) {
- return this.delegate.getParent(element);
- }
-
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
-
- if (project != null) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- JaxbPlatformDescription desc = jaxbProject.getPlatform().getDescription();
- JaxbPlatformUi platformUi =
- JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(desc);
-
- return platformUi != null;
- }
- }
- }
-
- if (this.delegate != null) {
- return this.delegate.hasChildren(element);
- }
-
- return false;
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) parentElement).getAdapter(IProject.class);
-
- if (project != null) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- JaxbPlatformDescription desc = jaxbProject.getPlatform().getDescription();
- JaxbPlatformUi platformUi =
- JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(desc);
-
- if (platformUi != null) {
- return new Object[] {jaxbProject.getContextRoot()};
- }
- }
- }
- }
-
- if (this.delegate != null) {
- return this.delegate.getChildren(parentElement);
- }
-
- return new Object[0];
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- // no op
- }
-
- public void restoreState(IMemento memento) {
- // no op
- }
-
-
- // **************** ICommonContentProvider implementation ******************
-
- public void init(ICommonContentExtensionSite config) {
- if (this.delegate == null) {
- JaxbNavigatorLabelProvider labelProvider = (JaxbNavigatorLabelProvider) config.getExtension().getLabelProvider();
- if (labelProvider != null && labelProvider.getDelegate() != null) {
- this.delegate = labelProvider.getDelegate();
- }
- else {
- this.delegate = new JaxbNavigatorContentAndLabelProvider();
- }
- }
- }
-
-
- // **************** member classes *****************************************
-
- private class JaxbProjectListener
- implements CollectionChangeListener
- {
- public void collectionChanged(CollectionChangeEvent event) {
- this.refreshViewer(null);
- }
- public void collectionCleared(CollectionClearEvent event) {
- this.refreshViewer(null);
- }
- public void itemsAdded(CollectionAddEvent event) {
- for (Object item : event.getItems()) {
- this.refreshViewer(((JaxbProject) item).getProject());
- }
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- for (Object item : event.getItems()) {
- this.refreshViewer(((JaxbProject) item).getProject());
- }
- }
-
- private void refreshViewer(final IProject project) {
- if (viewer != null
- && viewer.getControl() != null
- && !viewer.getControl().isDisposed()) {
- // Using job here so that project model update (which also uses
- // a job) will complete first
- Job refreshJob = new Job("Refresh viewer") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- // Using runnable here so that refresh will go on correct thread
- viewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (project != null) {
- viewer.refresh(project);
- }
- else {
- viewer.refresh();
- }
- }
- });
- return Status.OK_STATUS;
- }
- };
- if (project != null) {
- refreshJob.setRule(project);
- }
- refreshJob.schedule();
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index ee3b2cbeb3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.ui.internal.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-public class JaxbNavigatorItemLabelProviderFactory
- implements ItemLabelProviderFactory {
-
- /**
- * Exactly *one* of these factories is created for each view that utilizes it.
- * Therefore, as we delegate to the platform UI for each project, we should
- * maintain the same multiplicity. That is, if there is a delegate for each
- * platform UI, we should maintain *one* delegate for each view.
- *
- * Key: platform description, Value: delegate content provider factory
- */
- private final Map<JaxbPlatformDescription, ItemLabelProviderFactory> delegates;
-
-
- public JaxbNavigatorItemLabelProviderFactory() {
- super();
- this.delegates = new HashMap<JaxbPlatformDescription, ItemLabelProviderFactory>();
- }
-
- public ItemLabelProvider buildItemLabelProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- ItemLabelProviderFactory delegate = getDelegate(item);
- if (delegate != null) {
- return delegate.buildItemLabelProvider(item, contentAndLabelProvider);
- }
- return null;
- }
-
-
- private ItemLabelProviderFactory getDelegate(Object element) {
- if (! (element instanceof IAdaptable)) {
- return null;
- }
-
- JaxbContextNode contextNode = (JaxbContextNode) ((IAdaptable) element).getAdapter(JaxbContextNode.class);
-
- if (contextNode == null) {
- return null;
- }
-
- JaxbPlatformDescription platformDesc = contextNode.getJaxbProject().getPlatform().getDescription();
- if (delegates.containsKey(platformDesc)) {
- return delegates.get(platformDesc);
- }
- JaxbPlatformUi platformUi = JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(platformDesc);
- ItemLabelProviderFactory delegate =
- (platformUi == null) ? null : platformUi.getNavigatorUi().getItemLabelProviderFactory();
- delegates.put(platformDesc, delegate);
- return delegate;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java
deleted file mode 100644
index 615a7bac26..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorLabelProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.ui.internal.navigator;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * This extension of navigator label provider delegates to the platform UI
- * (see the org.eclipse.jpt.ui.jpaPlatform extension point) for navigator labels.
- *
- * This label provider provides a label for the root "JPA Content" node provided
- * by the content provider (see {@link JaxbNavigatorContentProvider}) and delegates
- * to the label provider returned by the platform UI implementation for labels
- * for children of the "JPA Content" node (or for any other sub-node).
- */
-public class JaxbNavigatorLabelProvider
- extends LabelProvider
- implements ICommonLabelProvider {
-
- private JaxbNavigatorContentAndLabelProvider delegate;
-
-
- public JaxbNavigatorLabelProvider() {
- super();
- }
-
-
- public JaxbNavigatorContentAndLabelProvider getDelegate() {
- return delegate;
- }
-
-
- // **************** IBaseLabelProvider implementation **********************
-
- @Override
- public void addListener(ILabelProviderListener listener) {
- if (delegate != null) {
- delegate.addListener(listener);
- }
- super.addListener(listener);
- }
-
- @Override
- public void removeListener(ILabelProviderListener listener) {
- super.removeListener(listener);
- if (delegate != null) {
- delegate.removeListener(listener);
- }
- }
-
- @Override
- public boolean isLabelProperty(Object element, String property) {
- if (delegate != null) {
- return delegate.isLabelProperty(element, property);
- }
-
- return super.isLabelProperty(element, property);
- }
-
- @Override
- public void dispose() {
- if (delegate != null) {
- delegate.dispose();
- }
- super.dispose();
- }
-
-
- // **************** ILabelProvider implementation **************************
-
- @Override
- public Image getImage(Object element) {
- if (delegate != null) {
- return delegate.getImage(element);
- }
-
- return super.getImage(element);
- }
-
- @Override
- public String getText(Object element) {
- if (delegate != null) {
- return delegate.getText(element);
- }
-
- return super.getText(element);
- }
-
-
- // **************** IDescriptionProvider implementation ********************
-
- public String getDescription(Object element) {
- if (delegate != null) {
- return delegate.getDescription(element);
- }
-
- return super.getText(element);
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- // no op
- }
-
- public void restoreState(IMemento memento) {
- // no op
- }
-
-
- // **************** ICommonLabelProvider implementation ********************
-
- public void init(ICommonContentExtensionSite config) {
- if (delegate == null) {
- JaxbNavigatorContentProvider contentProvider = (JaxbNavigatorContentProvider) config.getExtension().getContentProvider();
- if (contentProvider != null && contentProvider.getDelegate() != null) {
- delegate = contentProvider.getDelegate();
- }
- else {
- delegate = new JaxbNavigatorContentAndLabelProvider();
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
deleted file mode 100644
index 567fbb04f1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 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.ui.internal.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-public class JaxbNavigatorTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory {
-
- /**
- * Exactly *one* of these factories is created for each view that utilizes it.
- * Therefore, as we delegate to the platform UI for each project, we should
- * maintain the same multiplicity. That is, if there is a delegate for each
- * platform UI, we should maintain *one* delegate for each view.
- *
- * Key: platform id, Value: delegate content provider factory
- */
- private Map<JaxbPlatformDescription, TreeItemContentProviderFactory> delegates;
-
-
- public JaxbNavigatorTreeItemContentProviderFactory() {
- super();
- this.delegates = new HashMap<JaxbPlatformDescription, TreeItemContentProviderFactory>();
- }
-
- public TreeItemContentProvider buildItemContentProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- TreeItemContentProviderFactory delegate = getDelegate(item);
- if (delegate != null) {
- return delegate.buildItemContentProvider(item, contentAndLabelProvider);
- }
- return null;
- }
-
-
- private TreeItemContentProviderFactory getDelegate(Object element) {
- if (! (element instanceof IAdaptable)) {
- return null;
- }
-
- JaxbContextNode contextNode = (JaxbContextNode) ((IAdaptable) element).getAdapter(JaxbContextNode.class);
-
- if (contextNode == null) {
- return null;
- }
-
- JaxbPlatformDescription platformDesc = contextNode.getJaxbProject().getPlatform().getDescription();
- if (delegates.containsKey(platformDesc)) {
- return delegates.get(platformDesc);
- }
- JaxbPlatformUi platformUi = JptJaxbUiPlugin.getJaxbPlatformUiManager().getJaxbPlatformUi(platformDesc);
- TreeItemContentProviderFactory delegate =
- (platformUi == null) ? null : platformUi.getNavigatorUi().getTreeItemContentProviderFactory();
- delegates.put(platformDesc, delegate);
- return delegate;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
deleted file mode 100644
index b9d905d198..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiConfig.java
+++ /dev/null
@@ -1,70 +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.ui.internal.platform;
-
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-public class JaxbPlatformUiConfig {
-
- private String id;
- private String pluginId;
- private JaxbPlatformDescription jaxbPlatform;
- private String className;
- private JaxbPlatformUi platformUi;
-
-
- JaxbPlatformUiConfig() {
- super();
- }
-
-
- 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 JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- this.jaxbPlatform = jaxbPlatform;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- void setClassName(String className) {
- this.className = className;
- }
-
- public JaxbPlatformUi getPlatformUi() {
- if (this.platformUi == null) {
- this.platformUi = XPointTools.instantiate(
- this.pluginId, JaxbPlatformUiManagerImpl.QUALIFIED_EXTENSION_POINT_ID,
- this.className, JaxbPlatformUi.class);
- }
- return this.platformUi;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
deleted file mode 100644
index 9a82bc98d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/platform/JaxbPlatformUiManagerImpl.java
+++ /dev/null
@@ -1,133 +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
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.platform;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
-import java.util.ArrayList;
-import java.util.List;
-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.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUiManager;
-
-public class JaxbPlatformUiManagerImpl
- implements JaxbPlatformUiManager {
-
- static final String EXTENSION_POINT_ID = "jaxbPlatformUis"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbUiPlugin.PLUGIN_ID_ + EXTENSION_POINT_ID; //$NON-NLS-1$
- static final String PLATFORM_UI_ELEMENT = "jaxbPlatformUi"; //$NON-NLS-1$
- static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- static final String PLATFORM_ATTRIBUTE = "jaxbPlatform"; //$NON-NLS-1$
- static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
-
-
- private static final JaxbPlatformUiManagerImpl INSTANCE = new JaxbPlatformUiManagerImpl();
-
-
- public static JaxbPlatformUiManagerImpl instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, JaxbPlatformUiConfig> platformUiConfigs;
- private KeyedSet<JaxbPlatformDescription, JaxbPlatformUiConfig> platformToUiConfigs;
-
-
- // ********** constructor/initialization **********
-
- private JaxbPlatformUiManagerImpl() {
- super();
- this.platformUiConfigs = new KeyedSet<String, JaxbPlatformUiConfig>();
- this.platformToUiConfigs = new KeyedSet<JaxbPlatformDescription, JaxbPlatformUiConfig>();
- readExtensions();
- }
-
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbUiPlugin.PLUGIN_ID, EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- List<IConfigurationElement> platformUiConfigs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement configElement : extension.getConfigurationElements()) {
- if (configElement.getName().equals(PLATFORM_UI_ELEMENT)) {
- platformUiConfigs.add(configElement);
- }
- }
- }
-
- for (IConfigurationElement configElement: platformUiConfigs) {
- readPlatformUiExtension(configElement);
- }
- }
-
- private void readPlatformUiExtension(IConfigurationElement element) {
- try {
- JaxbPlatformUiConfig platformUiConfig = new JaxbPlatformUiConfig();
-
- // plug-in id
- platformUiConfig.setPluginId(element.getContributor().getName());
-
- // id
- platformUiConfig.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformUiConfigs.containsKey(platformUiConfig.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, platformUiConfig.getId());
- throw new XPointException();
- }
-
- // jaxb platform id
- String jaxbPlatformId = findRequiredAttribute(element, PLATFORM_ATTRIBUTE);
- JaxbPlatformDescription jaxbPlatform =
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(jaxbPlatformId);
-
- if (jaxbPlatform == null) {
- logInvalidValue(element, PLATFORM_ATTRIBUTE, jaxbPlatformId);
- }
-
- if (this.platformToUiConfigs.containsKey(jaxbPlatform)) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, PLATFORM_ATTRIBUTE, jaxbPlatformId);
- throw new XPointException();
- }
-
- platformUiConfig.setJaxbPlatform(jaxbPlatform);
-
- // class
- platformUiConfig.setClassName(findRequiredAttribute(element, CLASS_ATTRIBUTE));
-
- this.platformUiConfigs.addItem(platformUiConfig.getId(), platformUiConfig);
- this.platformToUiConfigs.addItem(jaxbPlatform, platformUiConfig);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
- public JaxbPlatformUi getJaxbPlatformUi(JaxbPlatformDescription platformDesc) {
- JaxbPlatformUiConfig config = this.platformToUiConfigs.getItem(platformDesc);
- return (config == null) ? null : config.getPlatformUi();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
deleted file mode 100644
index 96fb670b28..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.eclipse.jpt.jaxb.ui.internal.properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-/**
- * Treat the JAXB project as an "aspect" of the Eclipse project (IProject);
- * but the JAXB project is stored in the JAXB model, not the Eclipse project
- * itself....
- * We also need to listen for the JAXB project to be rebuilt if the user
- * changes the Eclipse project's JAXB platform (which is stored in the
- * Eclipse project's preferences).
- */
-class JaxbProjectModel
- extends AspectPropertyValueModelAdapter<IProject, JaxbProject> {
-
- /**
- * The JAXB project may also change via another page (notably, the project facets page).
- * In that case, the preference change occurs before we actually have another project,
- * so we must listen to the projects manager
- */
- private final CollectionChangeListener projectManagerListener;
-
-
- JaxbProjectModel(PropertyValueModel<IProject> projectModel) {
- super(projectModel);
- this.projectManagerListener = buildProjectManagerListener();
- }
-
- private CollectionChangeListener buildProjectManagerListener() {
- return new CollectionChangeAdapter() {
- // we are only looking for the project rebuild *add* event here so we can
- // determine if the platform has changed.
- // the other events are unimportant in this case
- @Override
- public void itemsAdded(CollectionAddEvent event) {
- platformChanged();
- }
- };
- }
-
- void platformChanged() {
- this.propertyChanged();
- }
-
- @Override
- protected void engageSubject_() {
- JptJaxbCorePlugin.getProjectManager().addCollectionChangeListener(
- JaxbProjectManager.JAXB_PROJECTS_COLLECTION,
- this.projectManagerListener);
- }
-
- @Override
- protected void disengageSubject_() {
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(
- JaxbProjectManager.JAXB_PROJECTS_COLLECTION,
- this.projectManagerListener);
- }
-
- @Override
- protected JaxbProject buildValue_() {
- return JptJaxbCorePlugin.getJaxbProject(this.subject);
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
deleted file mode 100644
index d9471eee5b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 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.ui.internal.properties;
-
-import static org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi.createInstallLibraryPanel;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.internal.utility.ICUStringCollator;
-import org.eclipse.jpt.common.ui.internal.properties.JptProjectPropertiesPage;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Way more complicated UI than you would think....
- */
-public class JaxbProjectPropertiesPage
- extends JptProjectPropertiesPage {
-
- public static final String PROP_ID = "org.eclipse.jpt.jaxb.ui.jaxbProjectPropertiesPage"; //$NON-NLS-1$
-
- private PropertyValueModel<JaxbProject> jaxbProjectModel;
-
- private BufferedWritablePropertyValueModel<JaxbPlatformDescription> platformModel;
- private PropertyChangeListener platformListener;
-
- /* private */ static final Comparator<String> STRING_COMPARATOR = new ICUStringCollator();
-
- // ************ construction ************
-
- public JaxbProjectPropertiesPage() {
- super();
- }
-
-
- @Override
- protected void buildModels() {
- this.jaxbProjectModel = new JaxbProjectModel(this.projectModel);
-
- this.platformModel = this.buildPlatformModel();
- this.platformListener = this.buildPlatformListener();
- }
-
-
- // ***** platform ID model
-
- private BufferedWritablePropertyValueModel<JaxbPlatformDescription> buildPlatformModel() {
- return new BufferedWritablePropertyValueModel<JaxbPlatformDescription>(
- new PlatformModel(this.jaxbProjectModel), this.trigger);
- }
-
- private PropertyChangeListener buildPlatformListener(){
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JaxbProjectPropertiesPage.this.platformChanged((JaxbPlatformDescription) event.getNewValue());
- }
- };
- }
-
- void platformChanged(JaxbPlatformDescription newPlatform) {
- if ( ! this.getControl().isDisposed()) {
- // handle null, in the case the jpa facet is changed via the facets page,
- // the library install delegate is temporarily null
- adjustLibraryProviders();
- }
- }
-
-
- // ********** LibraryFacetPropertyPage implementation **********
-
- @Override
- public IProjectFacetVersion getProjectFacetVersion() {
- return this.getFacetedProject().getInstalledVersion(JaxbFacet.FACET);
- }
-
- @Override
- protected void adjustLibraryProviders() {
- 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(this.platformModel.getValue());
- }
- }
- }
-
-
- // ********** page **********
-
- @Override
- protected void createWidgets(Composite parent) {
- buildPlatformGroup(parent);
-
- Control libraryProviderComposite = createInstallLibraryPanel(
- parent,
- getLibraryInstallDelegate(),
- JptJaxbUiMessages.JaxbFacetWizardPage_jaxbImplementationLabel);
-
- libraryProviderComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, JaxbHelpContextIds.PROPERTIES_JAVA_PERSISTENCE);
- }
-
- @Override
- protected void engageListeners() {
- super.engageListeners();
- this.platformModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.platformListener);
- }
-
- @Override
- public void disengageListeners() {
- this.platformModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.platformListener);
- super.disengageListeners();
- }
-
-
- // ********** platform group **********
-
- private void buildPlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptJaxbUiMessages.JaxbFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Combo platformDropDown = this.buildDropDown(group);
- SWTTools.bind(
- buildPlatformChoicesModel(),
- this.platformModel,
- platformDropDown,
- JAXB_PLATFORM_LABEL_CONVERTER);
-
- buildFacetsPageLink(group, JptJaxbUiMessages.JaxbFacetWizardPage_facetsPageLink);
- }
-
- /**
- * Add the project's JAXB platform if it is not on the list of valid
- * platforms.
- * <p>
- * This is probably only useful if the project is corrupted
- * and has a platform that exists in the registry but is not on the
- * list of valid platforms for the project's JAXB facet version.
- * Because, if the project's JAXB platform is completely invalid, there
- * would be no JAXB project!
- */
- @SuppressWarnings("unchecked")
- private ListValueModel<JaxbPlatformDescription> buildPlatformChoicesModel() {
- return new SortedListValueModelAdapter<JaxbPlatformDescription>(
- new SetCollectionValueModel<JaxbPlatformDescription>(
- new CompositeCollectionValueModel<CollectionValueModel<JaxbPlatformDescription>, JaxbPlatformDescription>(
- new PropertyCollectionValueModelAdapter<JaxbPlatformDescription>(this.platformModel),
- buildRegistryPlatformsModel())),
- JAXB_PLATFORM_COMPARATOR);
- }
-
- private CollectionValueModel<JaxbPlatformDescription> buildRegistryPlatformsModel() {
- Iterable<JaxbPlatformDescription> enabledPlatforms =
- new FilteringIterable<JaxbPlatformDescription>(
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatforms()) {
- @Override
- protected boolean accept(JaxbPlatformDescription o) {
- return o.supportsJaxbFacetVersion(getProjectFacetVersion());
- }
- };
- return new StaticCollectionValueModel<JaxbPlatformDescription>(enabledPlatforms);
- }
-
- private static final Comparator<JaxbPlatformDescription> JAXB_PLATFORM_COMPARATOR =
- new Comparator<JaxbPlatformDescription>() {
- public int compare(JaxbPlatformDescription desc1, JaxbPlatformDescription desc2) {
- return STRING_COMPARATOR.compare(desc1.getLabel(), desc2.getLabel());
- }
- };
-
- private static final StringConverter<JaxbPlatformDescription> JAXB_PLATFORM_LABEL_CONVERTER =
- new StringConverter<JaxbPlatformDescription>() {
- public String convertToString(JaxbPlatformDescription desc) {
- return desc.getLabel();
- }
- };
-
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- protected boolean projectRebuildRequired() {
- return this.platformModel.isBuffering();
- }
-
- @Override
- protected void rebuildProject() {
- // if the JAXB platform is changed, we need to completely rebuild the JAXB project
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(getProject());
- }
-
- @Override
- protected BufferedWritablePropertyValueModel<?>[] buildBufferedModels() {
- return new BufferedWritablePropertyValueModel[] {
- this.platformModel
- };
- }
-
-
- // ********** validation **********
-
- @Override
- protected Model[] buildValidationModels() {
- return new Model[] {
- platformModel
- };
- }
-
- @Override
- protected void performValidation(Map<Integer, ArrayList<IStatus>> statuses) {
- /* platform */
- // user is unable to unset the platform, so no validation necessary
-
- /* library provider */
- super.performValidation(statuses);
- }
-
-
- // ********** UI model adapters **********
-
- /**
- * Treat the JAXB platform as an "aspect" of the JAXB project.
- * The platform ID is stored in the project preferences.
- * The platform ID does not change for a JAXB project - if the user wants a
- * different platform, we build an entirely new JAXB project.
- */
- static class PlatformModel
- extends AspectPropertyValueModelAdapter<JaxbProject, JaxbPlatformDescription> {
-
- PlatformModel(PropertyValueModel<JaxbProject> jaxbProjectModel) {
- super(jaxbProjectModel);
- }
-
- @Override
- protected JaxbPlatformDescription buildValue_() {
- return this.subject.getPlatform().getDescription();
- }
-
- @Override
- public void setValue_(JaxbPlatformDescription newPlatform) {
- JptJaxbCorePlugin.setJaxbPlatform(this.subject.getProject(), newPlatform);
- }
-
- @Override
- protected void engageSubject_() {
- // the platform ID does not change
- }
-
- @Override
- protected void disengageSubject_() {
- // the platform ID does not change
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
deleted file mode 100644
index eedc507131..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
+++ /dev/null
@@ -1,912 +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.ui.internal.properties;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.layout.TableColumnLayout;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.ToolTip;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.SelectFileOrXMLCatalogIdPanel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.common.uriresolver.internal.URI;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * Shows the schemas associated with a JAXB project
- */
-public class JaxbSchemasPropertiesPage
- extends PropertyPage {
-
- private static final int SIZING_SELECTION_PANE_WIDTH = 450;
-
-
- protected final WritablePropertyValueModel<IProject> projectModel;
-
- private final PropertyValueModel<JaxbProject> jaxbProjectModel;
-
- protected final BufferedWritablePropertyValueModel.Trigger trigger;
-
- private final SchemasModel schemasModel;
-
- private final WritableCollectionValueModel<Schema> schemasSelectionModel;
-
-
- public JaxbSchemasPropertiesPage() {
- super();
- this.projectModel = new SimplePropertyValueModel<IProject>();
- this.jaxbProjectModel = new JaxbProjectModel(this.projectModel);
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
- this.schemasModel = new SchemasModel(this.jaxbProjectModel, this.trigger);
- this.schemasSelectionModel = new SimpleCollectionValueModel<Schema>();
- setDescription(JptJaxbUiMessages.SchemasPage_description);
- }
-
-
- protected IProject getProject() {
- return this.projectModel.getValue();
- }
-
- @Override
- public final void createControl(Composite parent ) {
- super.createControl( parent );
-
- Button revertButton = getDefaultsButton();
-
- revertButton.setText(JptJaxbUiMessages.SchemasPage_revert);
-
- GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- Point minButtonSize = revertButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- gd.widthHint = Math.max(convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH), minButtonSize.x);
- revertButton.setLayoutData(gd);
-
- updateButtons();
-
- getShell().layout(true, true);
- }
-
- @Override
- protected final Control createContents(Composite parent) {
- IAdaptable element = getElement();
-
- IProject project = null;
- if (element instanceof IProject) {
- project = (IProject) element;
- }
- else {
- project = (IProject) Platform.getAdapterManager().loadAdapter(element, IProject.class.getName());
- }
-
- this.projectModel.setValue(project);
-
- Composite pageComponent = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- pageComponent.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = SIZING_SELECTION_PANE_WIDTH;
- pageComponent.setLayoutData(data);
-
- Label schemasLabel = new Label(pageComponent, SWT.LEFT);
- schemasLabel.setText(JptJaxbUiMessages.SchemasPage_schemas);
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.horizontalSpan = 2;
- schemasLabel.setLayoutData(data);
-
- // create the table composite
- Composite tableComposite = new Composite(pageComponent, SWT.NONE);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.widthHint = SIZING_SELECTION_PANE_WIDTH;
- tableComposite.setLayoutData(data);
-
- // create the table
- TableViewer schemasTable = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
- TableModelAdapter.adapt(
- new SortedListValueModelAdapter<Schema>(this.schemasModel),
- this.schemasSelectionModel,
- schemasTable.getTable(),
- new SchemaColumnAdapter(),
- new SchemaTableLabelProvider());
- ColumnViewerToolTipSupport.enableFor(schemasTable, ToolTip.NO_RECREATE);
- schemasTable.getTable().setHeaderVisible(true);
- schemasTable.getTable().setToolTipText(null);
-
- // set the table composite layout (after the table, so that column information is available)
- TableColumnLayout tableLayout = new TableColumnLayout();
- tableLayout.setColumnData(schemasTable.getTable().getColumn(0), new ColumnWeightData(15));
- tableLayout.setColumnData(schemasTable.getTable().getColumn(1), new ColumnWeightData(25));
- tableComposite.setLayout(tableLayout);
-
- // set the table layout data
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = schemasTable.getTable().getItemHeight() * 7;
- data.widthHint = 200;
- schemasTable.getTable().setLayoutData(data);
-
- createButtonGroup(pageComponent);
-
- Dialog.applyDialogFont(parent);
-
- return pageComponent;
- }
-
- protected void createButtonGroup(Composite parent) {
- Composite groupComponent = new Composite(parent, SWT.NULL);
- GridLayout groupLayout = new GridLayout();
- groupLayout.marginWidth = 0;
- groupLayout.marginHeight = 0;
- groupComponent.setLayout(groupLayout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- groupComponent.setLayoutData(data);
-
- Button addButton = new Button(groupComponent, SWT.PUSH);
- addButton.setText(JptJaxbUiMessages.SchemasPage_addButtonLabel);
- addButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- addSchema();
- }
- });
- setButtonLayoutData(addButton);
-
- Button editButton = new Button(groupComponent, SWT.PUSH);
- editButton.setText(JptJaxbUiMessages.SchemasPage_editButtonLabel);
- editButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- editSelectedSchema();
- }
- });
- SWTTools.controlEnabledState(buildEditEnabledModel(), editButton);
- setButtonLayoutData(editButton);
-
- Button removeButton = new Button(groupComponent, SWT.PUSH);
- removeButton.setText(JptJaxbUiMessages.SchemasPage_removeButtonLabel);
- removeButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- removeSelectedSchemas();
- }
- });
- SWTTools.controlEnabledState(buildRemoveEnabledModel(), removeButton);
- setButtonLayoutData(removeButton);
- }
-
-
- private void addSchema() {
- // constructs a dialog for editing the new schema namespace and location
- AddEditSchemaDialog dialog =
- new AddEditSchemaDialog(
- getShell(),
- null,
- this.schemasModel.getValue());
-
- // opens the dialog - just returns if the user cancels it
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- // otherwise, adds the new schema
- Schema schema = this.schemasModel.addSchema(dialog.getNamespace(), dialog.getLocation());
-
- // select the new schema
- this.schemasSelectionModel.setValues(new SingleElementIterable<Schema>(schema));
- }
-
- private PropertyValueModel<Boolean> buildEditEnabledModel() {
- return new CollectionPropertyValueModelAdapter<Boolean>(this.schemasSelectionModel) {
- @Override
- protected Boolean buildValue() {
- return this.collectionModel.size() == 1;
- }
- };
- }
-
- private void editSelectedSchema() {
- // constructs a dialog for editing the new schema namespace and location
- final Schema schema = this.schemasSelectionModel.iterator().next();
- AddEditSchemaDialog dialog =
- new AddEditSchemaDialog(
- getShell(),
- schema,
- this.schemasModel.getValue());
-
- // opens the dialog - just returns if the user cancels it
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- // otherwise, changes the new schema
- schema.setNamespace(dialog.getNamespace());
- schema.setLocation(dialog.getLocation());
- }
-
- private PropertyValueModel<Boolean> buildRemoveEnabledModel() {
- return new CollectionPropertyValueModelAdapter<Boolean>(this.schemasSelectionModel) {
- @Override
- protected Boolean buildValue() {
- return this.collectionModel.size() >= 1;
- }
- };
- }
-
- private void removeSelectedSchemas() {
- this.schemasModel.removeSchemas(CollectionTools.iterable(this.schemasSelectionModel.iterator()));
- }
-
- private void updateButtons() {
- boolean enableApply = isValid();
- boolean enableRevert = true;
-
- Button applyButton = getApplyButton();
-
- if (applyButton != null) {
- applyButton.setEnabled(enableApply);
- }
-
- Button revertButton = getDefaultsButton();
-
- if (revertButton != null) {
- revertButton.setEnabled(enableRevert);
- }
- }
-
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- public boolean performOk() {
- try {
- // true=fork; false=uncancellable
- this.buildOkProgressMonitorDialog().run(true, false, this.buildOkRunnableWithProgress());
- }
- catch (InterruptedException ex) {
- return false;
- }
- catch (InvocationTargetException ex) {
- throw new RuntimeException(ex.getTargetException());
- }
-
- return true;
- }
-
- private IRunnableContext buildOkProgressMonitorDialog() {
- return new ProgressMonitorDialog(this.getShell());
- }
-
- private IRunnableWithProgress buildOkRunnableWithProgress() {
- return new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- try {
- // the build we execute in #performOk_() locks the workspace root,
- // so we need to use the workspace root as our scheduling rule here
- ws.run(
- buildOkWorkspaceRunnable(),
- ws.getRoot(),
- IWorkspace.AVOID_UPDATE,
- monitor);
- }
- catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
- };
- }
-
- /* private */ IWorkspaceRunnable buildOkWorkspaceRunnable() {
- return new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- performOk_(monitor);
- }
- };
- }
-
- void performOk_(IProgressMonitor monitor) throws CoreException {
- if (this.schemasModel.hasChanges()) {
- this.trigger.accept();
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(getProject());
- getProject().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- }
- }
-
- @Override
- protected void performDefaults() {
- this.trigger.reset();
- }
-
- @Override
- public void dispose() {
-
- super.dispose();
- }
-
-
- static class SchemasModel
- extends AspectAdapter<JaxbProject>
- implements CollectionValueModel<Schema> {
-
- /**
- * The collection of schemas
- */
- protected final Collection<Schema> schemas;
-
- /**
- * This is the trigger that indicates whether the buffered value
- * should be accepted or reset.
- */
- protected final PropertyValueModel<Boolean> triggerHolder;
-
- /** This listens to the trigger holder. */
- protected final PropertyChangeListener triggerChangeListener;
-
-
- SchemasModel(PropertyValueModel<JaxbProject> subjectHolder, PropertyValueModel<Boolean> triggerHolder) {
- super(subjectHolder);
- this.schemas = new ArrayList<Schema>();
- this.triggerHolder = triggerHolder;
- this.triggerChangeListener = buildTriggerChangeListener();
- }
-
-
- protected PropertyChangeListener buildTriggerChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- triggerChanged(event);
- }
- };
- }
-
- protected Collection<Schema> buildSchemas_() {
- ArrayList<Schema> schemas = new ArrayList<Schema>();
- for (Map.Entry<String, String> entry : this.subject.getSchemaLibrary().getSchemaLocations().entrySet()) {
- schemas.add(new Schema(entry.getKey(), entry.getValue()));
- }
- return schemas;
- }
-
- public boolean hasChanges() {
- return (this.subject == null) ? false : ! this.schemas.equals(buildSchemas_());
- }
-
- protected void triggerChanged(PropertyChangeEvent event) {
- if (hasChanges()) {
- if (this.subject != null && ((Boolean) event.getNewValue()).booleanValue()) {
- this.accept();
- } else {
- this.reset();
- }
- }
- }
-
- public void accept() {
- Map<String, String> schemaLocations = new HashMap<String, String>();
- for (Schema schema : this.schemas) {
- schemaLocations.put(schema.getNamespace(), schema.getLocation());
- }
- this.subject.getSchemaLibrary().setSchemaLocations(schemaLocations);
- }
-
- public void reset() {
- this.schemas.clear();
- if (this.subject != null) {
- this.schemas.addAll(buildSchemas_());
- }
- fireCollectionChanged(VALUES, getValue());
- }
-
- public Schema addSchema(String namespace, String location) {
- Schema schema = new Schema(namespace, location);
- addItemToCollection(schema, this.schemas, VALUES);
- return schema;
- }
-
- public void removeSchemas(Iterable<Schema> schemas) {
- removeItemsFromCollection(schemas, this.schemas, VALUES);
- }
-
-
- // ************ AspectAdapter impl ************************************
-
- @Override
- protected String getListenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected boolean hasListeners() {
- return hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- fireCollectionChanged(VALUES, getValue());
- }
-
- @Override
- protected void engageSubject_() {
- this.schemas.addAll(buildSchemas_());
- }
-
- @Override
- protected void disengageSubject_() {
- this.schemas.clear();
- }
-
- @Override
- protected void engageModels() {
- super.engageModels();
- this.triggerHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.triggerChangeListener);
- }
-
- @Override
- protected void disengageModels() {
- this.triggerHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.triggerChangeListener);
- super.disengageModels();
- }
-
- @Override
- protected Collection<Schema> getValue() {
- return CollectionTools.collection(iterator());
- }
-
-
- // ************ CollectionValueModel impl *****************************
-
- public Iterator<Schema> iterator() {
- return this.schemas.iterator();
- }
-
- public int size() {
- return this.schemas.size();
- }
- }
-
-
- static class Schema
- extends AbstractModel
- implements Comparable<Schema> {
-
- Schema(String namespace, String location) {
- super();
- this.namespace = namespace;
- this.location = location;
- }
-
-
- private String namespace;
- final static String NAMESPACE_PROPERTY = "namespace";
-
- private String location;
- final static String LOCATION_PROPERTY = "location";
-
-
- String getNamespace() {
- return this.namespace;
- }
-
- void setNamespace(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- String getLocation() {
- return this.location;
- }
-
- void setLocation(String location) {
- String old = this.location;
- this.location = location;
- firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- public int compareTo(Schema o) {
- return this.namespace.compareTo(o.namespace);
- }
- }
-
-
- static class SchemaColumnAdapter
- implements ColumnAdapter<Schema> {
-
- static final int COLUMN_COUNT = 2;
- static final int NAMESPACE_COLUMN = 0;
- static final int LOCATION_COLUMN = 1;
-
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
- switch (columnIndex) {
- case NAMESPACE_COLUMN :
- return JptJaxbUiMessages.SchemasPage_namespaceColumnLabel;
- case LOCATION_COLUMN :
- return JptJaxbUiMessages.SchemasPage_locationColumnLabel;
- default :
- return null;
- }
- }
-
- public WritablePropertyValueModel<?>[] cellModels(Schema subject) {
- WritablePropertyValueModel<?>[] cellModels = new WritablePropertyValueModel<?>[COLUMN_COUNT];
- cellModels[NAMESPACE_COLUMN] = buildNamespaceCellModel(subject);
- cellModels[LOCATION_COLUMN] = buildLocationCellModel(subject);
- return cellModels;
- }
-
- private WritablePropertyValueModel<String> buildNamespaceCellModel(Schema subject) {
- return new PropertyAspectAdapter<Schema, String>(Schema.NAMESPACE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getNamespace();
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildLocationCellModel(Schema subject) {
- return new PropertyAspectAdapter<Schema, String>(Schema.LOCATION_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getLocation();
- }
- };
- }
- }
-
-
- static class SchemaTableLabelProvider
- extends LabelProvider
- implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- switch (columnIndex) {
- case SchemaColumnAdapter.NAMESPACE_COLUMN :
- return ((Schema) element).getNamespace();
- case SchemaColumnAdapter.LOCATION_COLUMN :
- return ((Schema) element).getLocation();
- default :
- return null;
- }
- }
- }
-
-
- static class AddEditSchemaDialog
- extends TitleAreaDialog {
-
- private Schema currentSchema;
-
- private String defaultMessage;
-
- private final WritablePropertyValueModel<String> location;
-
- private final WritablePropertyValueModel<String> namespace;
-
- private XSDSchema resolvedSchema;
-
- private final Mode mode;
-
- private Iterable<Schema> allSchemas;
-
-
- public AddEditSchemaDialog(Shell shell, Schema currentSchema, Iterable<Schema> allSchemas) {
- super(shell);
- this.currentSchema = currentSchema;
- this.allSchemas = allSchemas;
- this.location = new SimplePropertyValueModel<String>();
- this.namespace = new SimplePropertyValueModel<String>();
-
- this.mode = (this.currentSchema == null) ? Mode.ADD : Mode.EDIT;
- if (this.mode == Mode.ADD) {
- this.defaultMessage = JptJaxbUiMessages.SchemasPage_addSchemaMessage;
- this.location.setValue("");
- this.namespace.setValue("");
- }
- else {
- this.defaultMessage = JptJaxbUiMessages.SchemasPage_editSchemaMessage;
- this.location.setValue(currentSchema.getLocation());
- this.namespace.setValue(currentSchema.getNamespace());
- }
- }
-
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- if (this.mode == Mode.ADD) {
- newShell.setText(JptJaxbUiMessages.SchemasPage_addSchemaDialogTitle);
- }
- else {
- newShell.setText(JptJaxbUiMessages.SchemasPage_editSchemaDialogTitle);
- }
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- setMessage(this.defaultMessage);
- if (this.mode == Mode.ADD) {
- setTitle(JptJaxbUiMessages.SchemasPage_addSchemaTitle);
- }
- else {
- setTitle(JptJaxbUiMessages.SchemasPage_editSchemaTitle);
- }
-
- Composite composite = new Composite(dialogArea, SWT.NONE);
- composite.setLayout(new GridLayout(3, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label locationLabel = new Label(composite, SWT.NULL);
- locationLabel.setText(JptJaxbUiMessages.SchemasPage_locationLabel);
- locationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
- final Text locationText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- locationText.setText(this.location.getValue());
- locationText.setEditable(false);
- locationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- this.location.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- locationText.setText((String) event.getNewValue());
- }
- });
-
- Button browseButton = new Button(composite, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.SchemasPage_browseButtonLabel);
- browseButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true, 1, 1));
- browseButton.addSelectionListener(
- new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- browseForSchemaLocation();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- Label namespaceLabel = new Label(composite, SWT.NULL);
- namespaceLabel.setText(JptJaxbUiMessages.SchemasPage_namespaceLabel);
- namespaceLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
- final Text namespaceText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- namespaceText.setText(this.namespace.getValue());
- namespaceText.setEditable(false);
- namespaceText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- this.namespace.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- String newValue = (String) event.getNewValue();
- String display = (StringTools.stringIsEmpty(newValue)) ?
- JptJaxbUiMessages.SchemasPage_noNamespaceText : newValue;
- namespaceText.setText(display);
- }
- });
-
- Dialog.applyDialogFont(dialogArea);
-
- return dialogArea;
- }
-
- @Override
- protected boolean isResizable() {
- return true;
- }
-
- private void browseForSchemaLocation() {
- SchemaLocationDialog dialog = new SchemaLocationDialog(getShell());
-
- // opens the dialog - just returns if the user cancels it
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- String location = dialog.getLocation();
- this.location.setValue(location);
-
- String resolvedUri = XsdUtil.getResolvedUri(null, location);
-
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- String newNamespace = (schema == null) ? null : schema.getTargetNamespace();
- this.namespace.setValue(newNamespace);
- this.resolvedSchema = schema;
-
- validate();
- }
-
- public String getNamespace() {
- return this.namespace.getValue();
- }
-
- public String getLocation() {
- return this.location.getValue();
- }
-
- private void validate() {
- if (this.resolvedSchema == null) {
- setErrorMessage(JptJaxbUiMessages.SchemasPage_schemaUnresolvedMessage);
- }
- else if (isDuplicateNamespace()) {
- setErrorMessage(JptJaxbUiMessages.SchemasPage_duplicateNamespaceMessage);
- }
- else if (StringTools.stringIsEmpty(this.location.getValue())) {
- setErrorMessage(JptJaxbUiMessages.SchemasPage_noLocationMessage);
- }
- else {
- setErrorMessage(null);
- setMessage(this.defaultMessage);
- }
- getButton(IDialogConstants.OK_ID).setEnabled(getErrorMessage() == null);
- }
-
- private boolean isDuplicateNamespace() {
- for (Schema schema : this.allSchemas) {
- if ((this.currentSchema != schema) && getNamespace().equals(schema.getNamespace())) {
- return true;
- }
- }
- return false;
- }
-
-
- private enum Mode {
- ADD,
- EDIT
- }
- }
-
-
- static class SchemaLocationDialog
- extends TrayDialog {
-
- private SelectFileOrXMLCatalogIdPanel locationPanel;
-
- private String location;
-
-
- public SchemaLocationDialog(Shell shell) {
- super(shell);
- }
-
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(JptJaxbUiMessages.SchemasPage_chooseLocationTitle);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- this.locationPanel = new SelectFileOrXMLCatalogIdPanel(composite, StructuredSelection.EMPTY);
- this.locationPanel.setFilterExtensions(new String[] {".xsd"});
- this.locationPanel.update();
- this.locationPanel.setVisibleHelper(true);
-
- return composite;
- }
-
- @Override
- protected boolean isResizable() {
- return true;
- }
-
- @Override
- protected void okPressed() {
- IFile file = this.locationPanel.getFile();
- if (file != null) {
- this.location = URI.createPlatformResourceURI(file.getFullPath().toString()).toString();
- }
- else {
- this.location = this.locationPanel.getXMLCatalogId();
- }
-
- super.okPressed();
- }
-
- public String getLocation() {
- return this.location;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java
deleted file mode 100644
index 89c3c8ca3e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/ProjectWizardPage.java
+++ /dev/null
@@ -1,246 +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.ui.internal.wizards;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-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.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * ProjectWizardPage
- */
-public class ProjectWizardPage extends WizardPage
-{
- private IJavaProject javaProject;
- private ProjectGroup projectGroup;
-
- // ********** static methods **********
-
- public static IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
- return null;
- }
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IJavaProject) {
- return (IJavaProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- IProject project = ((IResource) firstElement).getProject();
- return getJavaProjectFrom(project);
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject();
- }
- return null;
- }
-
- public static IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-
- // ********** constructor **********
-
- public ProjectWizardPage() {
- super("Java Project"); //$NON-NLS-1$
-
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorProjectWizardPage_desc);
- }
-
- public ProjectWizardPage(IJavaProject javaProject) {
- this();
-
- this.javaProject = javaProject;
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- return this.javaProject;
- }
-
- // ********** internal methods **********
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new FillLayout());
- this.projectGroup = new ProjectGroup(composite);
- Dialog.applyDialogFont(parent);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
- return composite;
- }
-
- private void setJavaProject(IJavaProject project) {
- this.javaProject = project;
- }
-
- private void projectChanged() {
- this.setPageComplete(false);
- String projectName = this.projectGroup.getProjectName();
- if( ! StringTools.stringIsEmpty(projectName)) {
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- this.setJavaProject(JavaCore.create(project));
- this.setPageComplete(true);
- }
- }
-
- // ********** project group **********
-
- class ProjectGroup {
-
- private Combo projectCombo;
-
-
- // ********** constructor **********
-
- private ProjectGroup(Composite parent) {
- super();
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(2, false));
-
- // Project
- this.buildLabel(composite, JptJaxbUiMessages.JavaProjectWizardPage_project);
- this.projectCombo = this.buildProjectCombo(composite, this.buildProjectComboSelectionListener());
- this.updateProjectCombo();
-
- setPageComplete( ! StringTools.stringIsEmpty(this.getProjectName()));
- }
-
- // ********** listeners **********
-
- private SelectionListener buildProjectComboSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // nothing special for "default" (double-click?)
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- ProjectGroup.this.selectedProjectChanged();
- }
- @Override
- public String toString() {
- return "JavaProjectWizardPage project combo-box selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- // ********** listener callbacks **********
-
- void selectedProjectChanged() {
- projectChanged();
- }
-
- // ********** intra-wizard methods **********
-
- protected String getProjectName() {
- return this.projectCombo.getText();
- }
-
- // ********** internal methods **********
-
- protected void updateProjectCombo() {
-
- this.projectCombo.removeAll();
-
- for (String name : this.getSortedJavaProjectsNames()) {
- this.projectCombo.add(name);
- }
- if(javaProject != null) {
- this.projectCombo.select(this.projectCombo.indexOf(javaProject.getProject().getName()));
- }
- }
-
- private String[] getSortedJavaProjectsNames() {
- return ArrayTools.sort(this.getJavaProjectsNames());
- }
-
- private String[] getJavaProjectsNames() {
- return ArrayTools.array(
- new TransformationIterable<IProject, String>(this.getJavaProjects()) {
- @Override
- protected String transform(IProject project) {
- return project.getName();
- }
- },
- new String[0]);
- }
-
- private Iterable<IProject> getJavaProjects() {
- return new FilteringIterable<IProject>(CollectionTools.collection(this.getProjects())) {
- @Override
- protected boolean accept(IProject next) {
- try {
- return next.hasNature(JavaCore.NATURE_ID);
- }
- catch (CoreException e) {
- return false;
- }
- }
- };
- }
-
- private Iterator<IProject> getProjects() {
- return new ArrayIterator<IProject>(ResourcesPlugin.getWorkspace().getRoot().getProjects());
- }
-
- // ********** UI components **********
-
- private Label buildLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setLayoutData(new GridData());
- label.setText(text);
- return label;
- }
-
- private Combo buildProjectCombo(Composite parent, SelectionListener listener) {
- Combo projectCombo = new Combo(parent, SWT.READ_ONLY);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.grabExcessHorizontalSpace = true;
- projectCombo.setLayoutData(gridData);
- projectCombo.addSelectionListener(listener);
- return projectCombo;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
deleted file mode 100644
index c0300c5825..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
+++ /dev/null
@@ -1,186 +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.ui.internal.wizards.classesgen;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * ClassesGeneratorExtensionOptionsWizardPage
- */
-public class ClassesGeneratorExtensionOptionsWizardPage extends WizardPage
-{
-
- private ExtensionOptionsComposite additionalArgsComposite;
-
- // ********** constructor **********
-
- protected ClassesGeneratorExtensionOptionsWizardPage() {
- super("Classes Generator Extension Options"); //$NON-NLS-1$
-
- this.initialize();
- }
-
- protected void initialize() {
- this.setTitle(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_title);
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.additionalArgsComposite = new ExtensionOptionsComposite(composite);
-
- return composite;
- }
-
- // ********** intra-wizard methods **********
-
- protected boolean allowsExtensions() {
- return this.additionalArgsComposite.allowsExtensions();
- }
-
- protected String getClasspath() {
- return this.additionalArgsComposite.getClasspath();
- }
-
- protected String getAdditionalArgs() {
- return this.additionalArgsComposite.getAdditionalArgs();
- }
-
- // ********** AdditionalArgsComposite **********
-
- class ExtensionOptionsComposite {
-
- private boolean allowsExtensions;
- private final Text classpathText;
- private final Button allowsExtensionsCheckBox;
-
- private final Text additionalArgsText;
-
- // ********** constructor **********
-
- private ExtensionOptionsComposite(Composite parent) {
- super();
- this.allowsExtensions = false;
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, HELP_CONTEXT_ID);
-
- this.allowsExtensionsCheckBox = this.buildAllowsExtensionsCheckBox(composite, this.buildAllowsExtensionsSelectionListener());
-
- // Classpath
- Label classpathLabel = new Label(composite, SWT.NONE);
- classpathLabel.setText(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_classpath);
- GridData gridData = new GridData();
- gridData.verticalIndent = 5;
- classpathLabel.setLayoutData(gridData);
- this.classpathText = this.buildClasspathText(composite);
-
- Label additionalArgsLabel = new Label(composite, SWT.NONE);
- additionalArgsLabel.setText(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_additionalArguments);
- gridData = new GridData();
- gridData.verticalIndent = 5;
- additionalArgsLabel.setLayoutData(gridData);
- this.additionalArgsText = this.buildAdditionalArgsText(composite);
- }
-
- // ********** UI components **********
-
- private Button buildAllowsExtensionsCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent = 5;
- checkBox.setLayoutData(gridData);
- checkBox.setText(JptJaxbUiMessages.ClassesGeneratorExtensionOptionsWizardPage_allowExtensions);
- checkBox.setSelection(this.allowsExtensions());
- checkBox.addSelectionListener(listener);
- return checkBox;
- }
-
- private Text buildClasspathText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
- gridData.verticalIndent = 1;
- gridData.heightHint = text.getLineHeight() * 3;
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
- return text;
- }
-
- private Text buildAdditionalArgsText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
- gridData.verticalIndent = 1;
- gridData.heightHint = text.getLineHeight() * 10;
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
- return text;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildAllowsExtensionsSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- ExtensionOptionsComposite.this.setAllowsExtensions(
- ExtensionOptionsComposite.this.allowsExtensionsCheckBox.getSelection());
- }
- };
- }
-
- // ********** intra-wizard methods **********
-
- protected boolean allowsExtensions() {
- return this.allowsExtensions;
- }
-
- protected void setAllowsExtensions(boolean allowsExtensions){
- this.allowsExtensions = allowsExtensions;
- }
-
- protected String getClasspath() {
- return this.classpathText.getText();
- }
-
- protected String getAdditionalArgs() {
- return this.additionalArgsText.getText();
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java
deleted file mode 100644
index dfa510aa12..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java
+++ /dev/null
@@ -1,805 +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.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * ClassesGeneratorOptionsWizardPage
- */
-public class ClassesGeneratorOptionsWizardPage extends WizardPage
-{
- private ProxyOptionsComposite proxyOptionsComposite;
- private Options1Composite options1Composite;
- private Options2Composite options2Composite;
-
- // ********** constructor **********
-
- protected ClassesGeneratorOptionsWizardPage() {
- super("Classes Generator Options"); //$NON-NLS-1$
-
- this.initialize();
- }
-
- protected void initialize() {
- this.setTitle(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_title);
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.proxyOptionsComposite = new ProxyOptionsComposite(composite);
-
- this.buildOptionsComposites(composite);
-
- return composite;
- }
-
- private void buildOptionsComposites(Composite parent) {
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(2, true));
-
- this.options1Composite = new Options1Composite(composite);
-
- this.options2Composite = new Options2Composite(composite);
- }
-
- // ********** intra-wizard methods **********
-
- protected String getProxy() {
- return this.proxyOptionsComposite.getProxy();
- }
-
- protected String getProxyFile() {
- return this.proxyOptionsComposite.getProxyFile();
- }
-
- protected boolean usesStrictValidation() {
- return this.options1Composite.usesStrictValidation();
- }
-
- protected boolean makesReadOnly() {
- return this.options1Composite.makesReadOnly();
- }
-
- protected boolean suppressesPackageInfoGen() {
- return this.options1Composite.suppressesPackageInfoGen();
- }
-
- protected boolean suppressesHeaderGen() {
- return this.options1Composite.suppressesHeaderGen();
- }
-
- protected boolean getTarget() {
- return this.options1Composite.targetIs20();
- }
-
- protected boolean isVerbose() {
- return this.options1Composite.isVerbose();
- }
-
- protected boolean isQuiet() {
- return this.options1Composite.isQuiet();
- }
-
- protected boolean treatsAsXmlSchema() {
- return this.options2Composite.treatsAsXmlSchema();
- }
-
- protected boolean treatsAsRelaxNg() {
- return this.options2Composite.treatsAsRelaxNg();
- }
-
- protected boolean treatsAsRelaxNgCompact() {
- return this.options2Composite.treatsAsRelaxNgCompact();
- }
-
- protected boolean treatsAsDtd() {
- return this.options2Composite.treatsAsDtd();
- }
-
- protected boolean treatsAsWsdl() {
- return this.options2Composite.treatsAsWsdl();
- }
-
- protected boolean showsVersion() {
- return this.options2Composite.showsVersion();
- }
-
- protected boolean showsHelp() {
- return this.options2Composite.showsHelp();
- }
-
- // ********** UI controls **********
-
- protected Button buildCheckBox(Composite parent, String text, SelectionListener listener, int verticalIndent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent= verticalIndent;
- checkBox.setLayoutData(gridData);
- checkBox.setText(text);
- checkBox.addSelectionListener(listener);
- return checkBox;
- }
-
- protected Button buildRadioButton(Composite parent, String text, SelectionListener listener, int horizontalSpan) {
- Button radioButton = new Button(parent, SWT.RADIO);
- GridData gridData = new GridData();
- gridData.horizontalSpan = horizontalSpan;
- radioButton.setLayoutData(gridData);
- radioButton.setText(text);
- radioButton.addSelectionListener(listener);
- return radioButton;
- }
-
- protected Text buildText(Composite parent, int horizontalSpan) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gridData.horizontalSpan = horizontalSpan;
- text.setLayoutData(gridData);
- return text;
- }
-
- protected void disableText(Text text) {
- text.setEnabled(false);
- text.setText(""); //$NON-NLS-1$
- }
-
- // ********** internal methods **********
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(this.getProject().getLocation());
- return relativePath.toOSString();
- }
-
- private IProject getProject() {
- return ((ClassesGeneratorWizard)this.getWizard()).getJavaProject().getProject();
- }
-
- // ********** ProxyOptionsComposite **********
-
- class ProxyOptionsComposite {
-
- private final Button noProxyRadioButton;
-
- private final Button proxyRadioButton;
- private final Text proxyText;
-
- private final Button proxyFileRadioButton;
- private final Text proxyFileText;
- private Button browseButton;
-
- // ********** constructor **********
-
- private ProxyOptionsComposite(Composite parent) {
- super();
- Group proxyGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- proxyGroup.setLayout(layout);
- proxyGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- proxyGroup.setText(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_proxyGroup);
-
- SelectionListener proxyButtonListener = this.buildProxyRadioButtonListener();
-
- this.noProxyRadioButton = buildRadioButton(proxyGroup,
- JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_noProxy, proxyButtonListener, 3);
-
- this.proxyRadioButton = buildRadioButton(proxyGroup,
- JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_proxy, proxyButtonListener, 1);
- this.proxyText = buildText(proxyGroup, 1);
- new Label(proxyGroup, SWT.WRAP); //empty label for spacing
-
- this.proxyFileRadioButton = buildRadioButton(proxyGroup,
- JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_proxyFile, proxyButtonListener, 1);
- this.proxyFileText = buildText(proxyGroup, 1);
- this.browseButton = this.buildBrowseButton(proxyGroup);
-
- this.noProxyRadioButton.setSelection(true);
- this.proxyButtonChanged();
- }
-
- private Button buildBrowseButton(Composite parent) {
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
-
- // Browse buttons
- Button browseButton = new Button(buttonComposite, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_browseButton);
- gridData = new GridData();
- gridData.horizontalAlignment= GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- browseButton.setLayoutData(gridData);
-
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String filePath = promptProxyFile();
- if ( ! StringTools.stringIsEmpty(filePath)) {
- ProxyOptionsComposite.this.proxyFileText.setText(makeRelativeToProjectPath(filePath));
- }
- }
- });
- return browseButton;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildProxyRadioButtonListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- proxyButtonChanged();
- }
- };
- }
-
- private void proxyButtonChanged() {
- boolean usesProxy = ! this.noProxyRadioButton.getSelection();
- if (usesProxy) {
- if (this.proxyRadioButton.getSelection()) {
- this.proxyText.setEnabled(true);
- disableText(this.proxyFileText);
- this.browseButton.setEnabled(false);
- }
- else if (this.proxyFileRadioButton.getSelection()) {
- this.proxyFileText.setEnabled(true);
- this.browseButton.setEnabled(true);
- disableText(this.proxyText);
- }
- }
- else {
- disableText(this.proxyText);
- disableText(this.proxyFileText);
- this.browseButton.setEnabled(false);
- }
- }
-
- // ********** internal methods **********
- /**
- * The Add button was clicked, its action invokes this action which should
- * prompt the user to select a file and return it.
- */
- private String promptProxyFile() {
- IWizard wizard = ClassesGeneratorOptionsWizardPage.this.getWizard();
- String projectPath = ((ClassesGeneratorWizard)wizard).getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_chooseAProxyFile);
- dialog.setFilterPath(projectPath);
-
- return dialog.open();
- }
-
- // ********** intra-wizard methods **********
-
- protected String getProxy() {
- return this.proxyText.getText();
- }
-
- protected String getProxyFile() {
- return this.proxyFileText.getText();
- }
- }
-
-
- // ********** Options1Composite **********
-
- class Options1Composite {
-
- private boolean usesStrictValidation;
- private final Button usesStrictValidationCheckBox;
-
- private boolean makesReadOnly;
- private final Button makesReadOnlyCheckBox;
-
- private boolean suppressesPackageInfoGen;
- private final Button suppressesPackageInfoGenCheckBox;
-
- private boolean suppressesHeaderGen;
- private final Button suppressesHeaderGenCheckBox;
-
- private boolean target;
- private final Button targetCheckBox;
-
- private boolean isVerbose;
- private final Button isVerboseCheckBox;
-
- private boolean isQuiet;
- private final Button isQuietCheckBox;
-
- // ********** constructor **********
-
- Options1Composite(Composite parent) {
- super();
- this.usesStrictValidation = true;
- this.makesReadOnly = false;
- this.suppressesPackageInfoGen = false;
- this.suppressesHeaderGen = false;
- this.target = false;
- this.isVerbose = false;
- this.isQuiet = false;
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.usesStrictValidationCheckBox = this.buildUsesStrictValidationCheckBox(composite, this.buildUsesStrictValidationSelectionListener());
- this.makesReadOnlyCheckBox = this.buildMakesReadOnlyCheckBox(composite, this.buildMakesReadOnlySelectionListener());
- this.suppressesPackageInfoGenCheckBox = this.buildSuppressesPackageInfoGenCheckBox(composite, this.buildSuppressesPackageInfoGenSelectionListener());
- this.suppressesHeaderGenCheckBox = this.buildSuppressesHeaderGenCheckBox(composite, this.buildSuppressesHeaderGenSelectionListener());
- this.targetCheckBox = this.buildTargetCheckBox(composite, this.buildTargetSelectionListener());
- this.isVerboseCheckBox = this.buildIsVerboseCheckBox(composite, this.buildIsVerboseSelectionListener());
- this.isQuietCheckBox = this.buildIsQuietCheckBox(composite, this.buildIsQuietSelectionListener());
- }
-
- // ********** UI components **********
-
- private Button buildUsesStrictValidationCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_useStrictValidation, listener, 5);
- checkBox.setSelection(this.usesStrictValidation());
- return checkBox;
- }
-
- private Button buildMakesReadOnlyCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_makeReadOnly, listener, 5);
- checkBox.setSelection(this.makesReadOnly());
- return checkBox;
- }
-
- private Button buildSuppressesPackageInfoGenCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen, listener, 5);
- checkBox.setSelection(this.suppressesPackageInfoGen());
- return checkBox;
- }
-
- private Button buildSuppressesHeaderGenCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_suppressesHeaderGen, listener, 5);
- checkBox.setSelection(this.suppressesHeaderGen());
- return checkBox;
- }
-
- private Button buildTargetCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_target, listener, 5);
- checkBox.setSelection(this.targetIs20());
- return checkBox;
- }
-
- private Button buildIsVerboseCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_verbose, listener, 5);
- checkBox.setSelection(this.isVerbose());
- return checkBox;
- }
-
- private Button buildIsQuietCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_quiet, listener, 5);
- checkBox.setSelection(this.isQuiet());
- return checkBox;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildUsesStrictValidationSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setUsesStrictValidation(
- Options1Composite.this.usesStrictValidationCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildMakesReadOnlySelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setMakesReadOnly(
- Options1Composite.this.makesReadOnlyCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildSuppressesPackageInfoGenSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setSuppressesPackageInfoGen(
- Options1Composite.this.suppressesPackageInfoGenCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildSuppressesHeaderGenSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setSuppressesHeaderGen(
- Options1Composite.this.suppressesHeaderGenCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTargetSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setTargetIs20(
- Options1Composite.this.targetCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildIsVerboseSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setIsVerbose(
- Options1Composite.this.isVerboseCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildIsQuietSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options1Composite.this.setIsQuiet(
- Options1Composite.this.isQuietCheckBox.getSelection());
- }
- };
- }
-
- // ********** getters/setters *********
-
- protected boolean usesStrictValidation() {
- return this.usesStrictValidation;
- }
-
- protected void setUsesStrictValidation(boolean usesStrictValidation){
- this.usesStrictValidation = usesStrictValidation;
- }
-
- protected boolean makesReadOnly() {
- return this.makesReadOnly;
- }
-
- protected void setMakesReadOnly(boolean makesReadOnly){
- this.makesReadOnly = makesReadOnly;
- }
-
- protected boolean suppressesPackageInfoGen() {
- return this.suppressesPackageInfoGen;
- }
-
- protected void setSuppressesPackageInfoGen(boolean suppressesPackageInfoGen){
- this.suppressesPackageInfoGen = suppressesPackageInfoGen;
- }
-
- protected boolean suppressesHeaderGen() {
- return this.suppressesHeaderGen;
- }
-
- protected void setSuppressesHeaderGen(boolean suppressesHeaderGen){
- this.suppressesHeaderGen = suppressesHeaderGen;
- }
-
- protected boolean targetIs20() {
- return this.target;
- }
-
- protected void setTargetIs20(boolean targetIs20){
- this.target = targetIs20;
- }
-
- protected boolean isVerbose() {
- return this.isVerbose;
- }
-
- protected void setIsVerbose(boolean isVerbose){
- this.isVerbose = isVerbose;
- }
-
- protected boolean isQuiet() {
- return this.isQuiet;
- }
-
- protected void setIsQuiet(boolean isQuiet){
- this.isQuiet = isQuiet;
- }
-
- }
-
- // ********** Options2Composite **********
-
- class Options2Composite {
-
- private boolean treatsAsXmlSchema;
- private final Button treatsAsXmlSchemaCheckBox;
-
- private boolean treatsAsRelaxNg;
- private final Button treatsAsRelaxNgCheckBox;
-
- private boolean treatsAsRelaxNgCompact;
- private final Button treatsAsRelaxNgCompactCheckBox;
-
- private boolean treatsAsDtd;
- private final Button treatsAsDtdCheckBox;
-
- private boolean treatsAsWsdl;
- private final Button treatsAsWsdlCheckBox;
-
- private boolean showsVersion;
- private final Button showsVersionCheckBox;
-
- private boolean showsHelp;
- private final Button showsHelpCheckBox;
-
- // ********** constructor **********
-
- Options2Composite(Composite parent) {
- super();
- this.treatsAsXmlSchema = false;
- this.treatsAsRelaxNg = false;
- this.treatsAsRelaxNgCompact = false;
- this.treatsAsDtd = false;
- this.treatsAsWsdl = false;
- this.showsVersion = false;
- this.showsHelp = false;
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.treatsAsXmlSchemaCheckBox = this.buildTreatsAsXmlSchemaCheckBox(composite, this.buildTreatsAsXmlSchemaSelectionListener());
- this.treatsAsRelaxNgCheckBox = this.buildTreatsAsRelaxNgCheckBox(composite, this.buildTreatsAsRelaxNgSelectionListener());
- this.treatsAsRelaxNgCompactCheckBox = this.buildTreatsAsRelaxNgCompactCheckBox(composite, this.buildTreatsAsRelaxNgCompactSelectionListener());
- this.treatsAsDtdCheckBox = this.buildTreatsAsDtdCheckBox(composite, this.buildTreatsAsDtdSelectionListener());
- this.treatsAsWsdlCheckBox = this.buildTreatsAsWsdlCheckBox(composite, this.buildTreatsAsWsdlSelectionListener());
- this.showsVersionCheckBox = this.buildVersionCheckBox(composite, this.buildVersionSelectionListener());
- this.showsHelpCheckBox = this.buildHelpCheckBox(composite, this.buildHelpSelectionListener());
- }
-
- // ********** UI components **********
-
- private Button buildTreatsAsXmlSchemaCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema, listener, 5);
- checkBox.setSelection(this.treatsAsXmlSchema());
- return checkBox;
- }
-
- private Button buildTreatsAsRelaxNgCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg, listener, 5);
- checkBox.setSelection(this.treatsAsRelaxNg());
- return checkBox;
- }
- private Button buildTreatsAsRelaxNgCompactCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact, listener, 5);
- checkBox.setSelection(this.treatsAsRelaxNgCompact());
- return checkBox;
- }
-
- private Button buildTreatsAsDtdCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsDtd, listener, 5);
- checkBox.setSelection(this.treatsAsDtd());
- return checkBox;
- }
-
- private Button buildTreatsAsWsdlCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_treatsAsWsdl, listener, 5);
- checkBox.setSelection(this.treatsAsWsdl());
- return checkBox;
- }
-
- private Button buildVersionCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_showsVersion, listener, 5);
- checkBox.setSelection(this.showsVersion());
- return checkBox;
- }
-
- private Button buildHelpCheckBox(Composite parent, SelectionListener listener) {
- Button checkBox = buildCheckBox(parent, JptJaxbUiMessages.ClassesGeneratorOptionsWizardPage_showsHelp, listener, 5);
- checkBox.setSelection(this.showsHelp());
- return checkBox;
- }
-
- // ********** listeners **********
-
- private SelectionListener buildTreatsAsXmlSchemaSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsXmlSchema(
- Options2Composite.this.treatsAsXmlSchemaCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsRelaxNgSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsRelaxNg(
- Options2Composite.this.treatsAsRelaxNgCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsRelaxNgCompactSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsRelaxNgCompact(
- Options2Composite.this.treatsAsRelaxNgCompactCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsDtdSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsDtd(
- Options2Composite.this.treatsAsDtdCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildTreatsAsWsdlSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setTreatsAsWsdl(
- Options2Composite.this.treatsAsWsdlCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildVersionSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setShowsVersion(
- Options2Composite.this.showsVersionCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildHelpSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- Options2Composite.this.setShowsHelp(
- Options2Composite.this.showsHelpCheckBox.getSelection());
- }
- };
- }
-
- // ********** getter/setter *********
-
- protected boolean treatsAsXmlSchema() {
- return this.treatsAsXmlSchema;
- }
-
- protected void setTreatsAsXmlSchema(boolean treatsAsXmlSchema){
- this.treatsAsXmlSchema = treatsAsXmlSchema;
- }
-
- protected boolean treatsAsRelaxNg() {
- return this.treatsAsRelaxNg;
- }
-
- protected void setTreatsAsRelaxNg(boolean treatsAsRelaxNg){
- this.treatsAsRelaxNg = treatsAsRelaxNg;
- }
-
- protected boolean treatsAsRelaxNgCompact() {
- return this.treatsAsRelaxNgCompact;
- }
-
- protected void setTreatsAsRelaxNgCompact(boolean treatsAsRelaxNgCompact){
- this.treatsAsRelaxNgCompact = treatsAsRelaxNgCompact;
- }
-
- protected boolean treatsAsDtd() {
- return this.treatsAsDtd;
- }
-
- protected void setTreatsAsDtd(boolean treatsAsDtd){
- this.treatsAsDtd = treatsAsDtd;
- }
-
- protected boolean treatsAsWsdl() {
- return this.treatsAsWsdl;
- }
-
- protected void setTreatsAsWsdl(boolean treatsAsWsdl){
- this.treatsAsWsdl = treatsAsWsdl;
- }
-
- protected boolean showsVersion() {
- return this.showsVersion;
- }
-
- protected void setShowsVersion(boolean showsVersion){
- this.showsVersion = showsVersion;
- }
-
- protected boolean showsHelp() {
- return this.showsHelp;
- }
-
- protected void setShowsHelp(boolean showsHelp){
- this.showsHelp = showsHelp;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
deleted file mode 100644
index 5970a90004..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
+++ /dev/null
@@ -1,358 +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.ui.internal.wizards.classesgen;
-
-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.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorExtensionOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGeneratorOptions;
-import org.eclipse.jpt.jaxb.core.internal.gen.GenerateJaxbClassesJob;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * ClassesGeneratorWizard
- */
-public class ClassesGeneratorWizard extends Wizard implements IWorkbenchWizard {
-
- private IJavaProject javaProject;
- private String schemaPathOrUri;
- protected IStructuredSelection selection;
-
- private String destinationFolder;
- private String targetPackage;
- private String catalog;
- private boolean usesMoxy;
- private String[] bindingsFileNames;
- private ClassesGeneratorOptions generatorOptions;
- private ClassesGeneratorExtensionOptions generatorExtensionOptions;
-
- private JavaProjectWizardPage projectWizardPage;
- private SchemaWizardPage schemaWizardPage;
-
- private ClassesGeneratorWizardPage settingsPage;
- private ClassesGeneratorOptionsWizardPage optionsPage;
- private ClassesGeneratorExtensionOptionsWizardPage extensionOptionsPage;
- private boolean performsGeneration;
-
- // ********** constructor **********
-
- public ClassesGeneratorWizard() {
- super();
- this.performsGeneration = true;
- }
-
- public ClassesGeneratorWizard(IJavaProject javaProject, String xsdSchemaPath) {
- super();
- this.javaProject = javaProject;
- this.schemaPathOrUri = xsdSchemaPath;
-
- this.performsGeneration = false;
- }
-
- // ********** IWorkbenchWizard implementation **********
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
-
- this.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.CLASSES_GEN_WIZ_BANNER));
- this.setNeedsProgressMonitor(true);
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- if(this.selection != null) {
- this.javaProject = this.getJavaProjectFromSelection(this.selection);
-
- this.projectWizardPage = new JavaProjectWizardPage(this.javaProject);
- this.projectWizardPage.setTitle(JptJaxbUiMessages.ClassesGeneratorProjectWizardPage_title);
- this.projectWizardPage.setDescription(JptJaxbUiMessages.ClassesGeneratorProjectWizardPage_desc);
- this.projectWizardPage.setDestinationLabel(JptJaxbUiMessages.JavaProjectWizardPage_destinationProject);
- this.addPage(this.projectWizardPage);
-
- // SchemaWizardPage
- IFile schemaSelected = SchemaWizardPage.getSourceSchemaFromSelection(this.selection);
- if(schemaSelected == null) {
- this.schemaWizardPage = new SchemaWizardPage(this.selection);
- this.addPage(this.schemaWizardPage);
- }
- else {
- this.schemaPathOrUri = this.makeRelativeToProjectPath(schemaSelected.getFullPath());
- }
- }
- this.settingsPage = this.buildClassesGeneratorPage();
- this.optionsPage = this.buildClassesGeneratorOptionsPage();
- this.extensionOptionsPage = this.buildExtensionOptionsPage();
-
- this.addPage(this.settingsPage);
- this.addPage(this.optionsPage);
- this.addPage(this.extensionOptionsPage);
- }
-
- @Override
- public boolean performFinish() {
-
- WizardPage currentPage = (WizardPage)getContainer().getCurrentPage();
- if(currentPage != null) {
- if( ! currentPage.isPageComplete()) {
- return false;
- }
- this.retrieveGeneratorSettings();
- this.retrieveGeneratorOptions();
- this.retrieveGeneratorExtensionOptions();
-
- IFolder folder = this.getJavaProject().getProject().getFolder(this.destinationFolder);
- this.createFolderIfNotExist(folder);
- }
-
- if(this.performsGeneration) {
- if(this.displayOverridingClassesWarning(this.generatorOptions)) {
- this.generateJaxbClasses();
- }
- }
-
- return true;
- }
-
- @Override
- public boolean canFinish() {
- return (this.settingsPage.isPageComplete() &&
- this.optionsPage.isPageComplete() &&
- this.extensionOptionsPage.isPageComplete());
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- if(this.projectWizardPage != null) {
- this.javaProject = this.projectWizardPage.getJavaProject();
- }
- return this.javaProject;
- }
-
- public String getSchemaPathOrUri() {
- if(this.schemaWizardPage != null) {
- IFile schemaFile = this.schemaWizardPage.getSourceSchema();
- if(schemaFile != null) {
- return this.makeRelativeToProjectPath(schemaFile.getFullPath());
- }
- else {
- return this.schemaWizardPage.getSourceURI();
- }
- }
- return this.schemaPathOrUri;
- }
-
- private String makeRelativeToProjectPath(IPath path) {
- IPath relativePath = path.makeRelativeTo(this.getJavaProject().getProject().getFullPath());
- return relativePath.toOSString();
- }
-
- // ********** public methods **********
-
- public String getDestinationFolder() {
- return this.destinationFolder;
- }
-
- public String getTargetPackage() {
- return this.targetPackage;
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public boolean usesMoxy() {
- return this.usesMoxy;
- }
-
- public String[] getBindingsFileNames() {
- return this.bindingsFileNames;
- }
-
- public ClassesGeneratorOptions getGeneratorOptions() {
- return this.generatorOptions;
- }
-
- public ClassesGeneratorExtensionOptions getGeneratorExtensionOptions() {
- return this.generatorExtensionOptions;
- }
-
- // ********** internal methods **********
-
- public IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
- return null;
- }
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IJavaProject) {
- return (IJavaProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- IProject project = ((IResource) firstElement).getProject();
- return getJavaProjectFrom(project);
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject();
- }
- return null;
- }
-
- public IJavaProject getJavaProjectFrom(IProject project) {
- return (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- }
-
- private boolean displayOverridingClassesWarning(ClassesGeneratorOptions generatorOptions) {
-
- if( ! this.isOverridingClasses(generatorOptions)) {
- return true;
- }
- return MessageDialog.openQuestion(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningTitle,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningMessage);
- }
-
- private boolean isOverridingClasses(ClassesGeneratorOptions generatorOptions) {
- if(generatorOptions == null) {
- throw new NullPointerException();
- }
- if(generatorOptions.showsVersion() || generatorOptions.showsHelp()) {
- return false;
- }
- return true;
- }
-
- private void generateJaxbClasses() {
- try {
- WorkspaceJob job = new GenerateJaxbClassesJob(
- this.getJavaProject(),
- this.getSchemaPathOrUri(),
- this.destinationFolder,
- this.targetPackage,
- this.catalog,
- this.usesMoxy,
- this.bindingsFileNames,
- this.generatorOptions,
- this.generatorExtensionOptions);
- job.schedule();
- }
- catch(RuntimeException re) {
- JptJaxbUiPlugin.log(re);
-
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
- this.logError(message);
- }
- }
-
- private void retrieveGeneratorSettings() {
- this.destinationFolder = this.settingsPage.getTargetFolder();
- this.targetPackage = this.settingsPage.getTargetPackage();
- this.catalog = this.settingsPage.getCatalog();
- this.usesMoxy = this.settingsPage.usesMoxy();
- this.bindingsFileNames = this.settingsPage.getBindingsFileNames();
- }
-
- private void retrieveGeneratorOptions() {
- this.generatorOptions = new ClassesGeneratorOptions();
-
- this.generatorOptions.setProxy(this.optionsPage.getProxy());
- this.generatorOptions.setProxyFile(this.optionsPage.getProxyFile());
-
- this.generatorOptions.setUsesStrictValidation(this.optionsPage.usesStrictValidation());
- this.generatorOptions.setMakesReadOnly(this.optionsPage.makesReadOnly());
- this.generatorOptions.setSuppressesPackageInfoGen(this.optionsPage.suppressesPackageInfoGen());
- this.generatorOptions.setSuppressesHeaderGen(this.optionsPage.suppressesHeaderGen());
- this.generatorOptions.setTargetIs20(this.optionsPage.getTarget());
- this.generatorOptions.setIsVerbose(this.optionsPage.isVerbose());
- this.generatorOptions.setIsQuiet(this.optionsPage.isQuiet());
-
- this.generatorOptions.setTreatsAsXmlSchema(this.optionsPage.treatsAsXmlSchema());
- this.generatorOptions.setTreatsAsRelaxNg(this.optionsPage.treatsAsRelaxNg());
- this.generatorOptions.setTreatsAsRelaxNgCompact(this.optionsPage.treatsAsRelaxNgCompact());
- this.generatorOptions.setTreatsAsDtd(this.optionsPage.treatsAsDtd());
- this.generatorOptions.setTreatsAsWsdl(this.optionsPage.treatsAsWsdl());
- this.generatorOptions.setShowsVersion(this.optionsPage.showsVersion());
- this.generatorOptions.setShowsHelp(this.optionsPage.showsHelp());
- }
-
- private void retrieveGeneratorExtensionOptions() {
-
- this.generatorExtensionOptions = new ClassesGeneratorExtensionOptions();
-
- this.generatorExtensionOptions.setAllowsExtensions(this.extensionOptionsPage.allowsExtensions());
- this.generatorExtensionOptions.setClasspath(this.extensionOptionsPage.getClasspath());
- this.generatorExtensionOptions.setAdditionalArgs(this.extensionOptionsPage.getAdditionalArgs());
- }
-
- private ClassesGeneratorWizardPage buildClassesGeneratorPage() {
-
- return new ClassesGeneratorWizardPage();
- }
-
- private ClassesGeneratorOptionsWizardPage buildClassesGeneratorOptionsPage() {
- return new ClassesGeneratorOptionsWizardPage();
- }
-
- private ClassesGeneratorExtensionOptionsWizardPage buildExtensionOptionsPage() {
- return new ClassesGeneratorExtensionOptionsWizardPage();
- }
-
- private void createFolderIfNotExist(IFolder folder) {
- if( folder.exists()) {
- return;
- }
- try {
- folder.create(true, true, null);
- }
- catch (CoreException e) {
- JptJaxbUiPlugin.log(e);
-
- this.logError(NLS.bind(
- JptJaxbUiMessages.ClassesGeneratorWizard_couldNotCreate,
- folder.getProjectRelativePath().toOSString()));
- }
- }
-
- protected void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorWizard_errorDialogTitle,
- message
- );
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
deleted file mode 100644
index d1676f5c21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
+++ /dev/null
@@ -1,643 +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.ui.internal.wizards.classesgen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
-import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter;
-import org.eclipse.jdt.ui.JavaElementComparator;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGenerator;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.osgi.framework.Bundle;
-
-/**
- * ClassesGeneratorWizardPage
- */
-public class ClassesGeneratorWizardPage extends NewTypeWizardPage {
- static public String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.ui"; //$NON-NLS-1$
- static public String XML_FILTER = "*.xml"; //$NON-NLS-1$
- static public String BINDINGS_FILE_FILTER = "*.xjb;*.xml;*.xbd"; //$NON-NLS-1$
-
- public static final String HELP_CONTEXT_ID = "org.eclipse.jpt.ui.configure_jaxb_class_generation_dialog"; //$NON-NLS-1$
-
- private SettingsGroup settingsGroup;
-
- private String targetFolder;
- private String targetPackage;
-
- private Button usesMoxyCheckBox;
- private boolean usesMoxy;
-
- // ********** constructor **********
-
- public ClassesGeneratorWizardPage() {
- super(true, "Classes Generator"); //$NON-NLS-1$
-
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- // ********** intra-wizard methods **********
-
- protected String getTargetFolder() {
- return this.targetFolder;
- }
-
- protected String getTargetPackage() {
- return this.targetPackage;
- }
-
- protected String getCatalog() {
- return this.settingsGroup.getCatalog();
- }
-
- protected String[] getBindingsFileNames() {
- return this.settingsGroup.getBindingsFileNames();
- }
-
- protected boolean usesMoxy() {
- return this.usesMoxy;
- }
-
- protected void setUsesMoxy(boolean usesMoxy){
- this.usesMoxy = usesMoxy;
- }
-
- // ********** internal methods **********
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
-
- this.settingsGroup = new SettingsGroup(composite);
-
- this.usesMoxyCheckBox = this.buildUsesMoxyCheckBox(composite);
-
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- private Button buildUsesMoxyCheckBox(Composite parent) {
-
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent = 10;
- checkBox.setLayoutData(gridData);
- checkBox.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_usesMoxyImplementation);
- checkBox.setSelection(this.usesMoxy());
- checkBox.addSelectionListener(this.buildUsesMoxySelectionListener());
-
- return checkBox;
- }
-
- private SelectionListener buildUsesMoxySelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
-
- public void widgetSelected(SelectionEvent event) {
- setUsesMoxy(usesMoxyCheckBox.getSelection());
- validateProjectClasspath();
- }
- };
- }
-
- private boolean jptEclipseLinkBundleExists() {
- return (this.getJptEclipseLinkBundle() != null);
- }
-
- private Bundle getJptEclipseLinkBundle() {
- return Platform.getBundle(JPT_ECLIPSELINK_UI_PLUGIN_ID); // Cannot reference directly EL plugin.
- }
-
- private void validateProjectClasspath() {
- //this line will suppress the "default package" warning (which doesn't really apply here
- //as the JAXB gen uses an org.example.schemaName package by default) and will clear the classpath warnings when necessary
- setMessage(null);
-
- if ( ! this.genericJaxbIsOnClasspath()) {
- this.displayWarning(JptJaxbUiMessages.ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable);
- }
- else if (this.usesMoxy() && ! this.moxyIsOnClasspath()) {
- //this message is being truncated by the wizard width in some cases
- this.displayWarning(JptJaxbUiMessages.ClassesGeneratorWizardPage_moxyLibrariesNotAvailable);
- }
-
- //this code will intelligently remove our classpath warnings when they are present but no longer apply (as an alternative
- //to setting the message to null continuously as is currently done)
-// else if( this.getMessage() != null){
-// if (this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable) ||
-// this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_moxyLibrariesNotAvailable)) {
-// setMessage(null);
-// }
-// }
- }
-
- private void displayWarning(String message) {
- this.setMessage(message, WARNING);
- }
-
- /**
- * Test if the Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbIsOnClasspath() {
- try {
- String className = ClassesGenerator.JAXB_GENERIC_GEN_CLASS;
- IType genClass = this.getJavaProject().findType(className);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the EclipseLink Jaxb compiler is on the classpath.
- */
- private boolean moxyIsOnClasspath() {
- try {
- String className = ClassesGenerator.JAXB_ECLIPSELINK_GEN_CLASS;
- IType genClass = this.getJavaProject().findType(className);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** overrides **********
-
- @Override
- protected IStatus packageChanged() {
- IStatus status = super.packageChanged();
- IPackageFragment packageFragment = getPackageFragment();
- if (!status.matches(IStatus.ERROR)) {
- this.targetPackage = packageFragment.getElementName();
- }
- return status;
- }
-
- @Override
- protected IStatus containerChanged() {
- IStatus status = super.containerChanged();
- String srcFolder = getPackageFragmentRootText();
- if( !status.matches(IStatus.ERROR) ){
- this.targetFolder = srcFolder.substring(srcFolder.indexOf("/") + 1);
- }
- return status;
- }
-
- @Override
- protected void handleFieldChanged(String fieldName) {
- super.handleFieldChanged(fieldName);
- if (this.fContainerStatus.matches(IStatus.ERROR)) {
- updateStatus(fContainerStatus);
- }else if( ! this.fPackageStatus.matches(IStatus.OK) ) {
- updateStatus(fPackageStatus);
- } else {
- updateStatus(Status.OK_STATUS);
- }
- validateProjectClasspath();
- }
-
- /**
- * Override setVisible to insure that our more important warning
- * message about classpath problems is displayed to the user first.
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible) {
- this.initContainerPage(((ClassesGeneratorWizard)this.getWizard()).getJavaProject());
-
- // default usesMoxy to true only when JPT EclipseLink bundle exists and MOXy is on the classpath
- this.usesMoxy = (this.jptEclipseLinkBundleExists() && this.moxyIsOnClasspath());
-
- // checkbox is visible only if jpt.eclipselink.ui plugin is available
- // and EclipseLink MOXy is not on the classpath
- this.usesMoxyCheckBox.setVisible(this.jptEclipseLinkBundleExists() && ! this.moxyIsOnClasspath());
- this.validateProjectClasspath();
-
- String schemaPathOrUri = ((ClassesGeneratorWizard)this.getWizard()).getSchemaPathOrUri();
- this.setTitle(NLS.bind(JptJaxbUiMessages.ClassesGeneratorWizardPage_title, schemaPathOrUri));
- }
- }
-
- /**
- * Override to allow selection of source folder in current project only
- * @see org.eclipse.jdt.ui.wizards.NewContainerWizardPage#chooseContainer()
- * Only 1 line in this code is different from the parent
- */
- @Override
- protected IPackageFragmentRoot chooseContainer() {
- Class<?>[] acceptedClasses = new Class[] { IPackageFragmentRoot.class, IJavaProject.class };
- TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false) {
- @Override
- public boolean isSelectedValid(Object element) {
- try {
- if (element instanceof IJavaProject) {
- IJavaProject jproject= (IJavaProject)element;
- IPath path= jproject.getProject().getFullPath();
- return (jproject.findPackageFragmentRoot(path) != null);
- } else if (element instanceof IPackageFragmentRoot) {
- return (((IPackageFragmentRoot)element).getKind() == IPackageFragmentRoot.K_SOURCE);
- }
- return true;
- } catch (JavaModelException e) {
- JptJaxbUiPlugin.log(e); // just log, no UI in validation
- }
- return false;
- }
- };
-
- acceptedClasses= new Class[] { IJavaModel.class, IPackageFragmentRoot.class, IJavaProject.class };
- ViewerFilter filter= new TypedViewerFilter(acceptedClasses) {
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IPackageFragmentRoot) {
- try {
- return (((IPackageFragmentRoot)element).getKind() == IPackageFragmentRoot.K_SOURCE);
- } catch (JavaModelException e) {
- JptJaxbUiPlugin.log(e.getStatus()); // just log, no UI in validation
- return false;
- }
- }
- return super.select(viewer, parent, element);
- }
- };
-
- StandardJavaElementContentProvider provider= new StandardJavaElementContentProvider();
- ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
- ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), labelProvider, provider);
- dialog.setValidator(validator);
- dialog.setComparator(new JavaElementComparator());
- dialog.setTitle(JptJaxbUiMessages.ClassesGeneratorWizardPage_sourceFolderSelectionDialog_title);
- dialog.setMessage(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseSourceFolderDialog_desc);
- dialog.addFilter(filter);
- //set the java project as the input instead of the workspace like the NewContainerWizardPage was doing
- //******************************************************//
- dialog.setInput(this.getJavaProject()); //
- //******************************************************//
- dialog.setInitialSelection(getPackageFragmentRoot());
- dialog.setHelpAvailable(false);
-
- if (dialog.open() == Window.OK) {
- Object element= dialog.getFirstResult();
- if (element instanceof IJavaProject) {
- IJavaProject jproject= (IJavaProject)element;
- return jproject.getPackageFragmentRoot(jproject.getProject());
- } else if (element instanceof IPackageFragmentRoot) {
- return (IPackageFragmentRoot)element;
- }
- return null;
- }
- return null;
- }
-
- // ********** SettingsGroup class **********
-
- private class SettingsGroup {
-
- private final Text catalogText;
-
- private final ArrayList<String> bindingsFileNames;
-
- // ********** constructor **********
-
- private SettingsGroup(Composite parent) {
- super();
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(4, false); //must be 4 for the package controls
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, HELP_CONTEXT_ID);
-
- // Source folder
- createContainerControls(composite, 4);
-
- // Package
- createPackageControls(composite, 4);
-
- Label label = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 4, 1);
- gridData.verticalIndent = 5;
- label.setLayoutData(gridData);
-
- // Catalog
- Label catalogLabel = new Label(composite, SWT.NONE);
- catalogLabel.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_catalog);
- gridData = new GridData();
- gridData.verticalIndent = 5;
- catalogLabel.setLayoutData(gridData);
- this.catalogText = this.buildCatalogText(composite);
- this.buildBrowseButton(composite);
-
- // Bindings files
- this.bindingsFileNames = new ArrayList<String>();
- Label bindingsFileLabel = new Label(composite, SWT.NONE);
- bindingsFileLabel.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_bindingsFiles);
- bindingsFileLabel.setLayoutData(new GridData());
- this.buildBindingsFileTable(composite);
- }
-
- // ********** intra-wizard methods **********
-
- protected String getCatalog() {
- return this.catalogText.getText();
- }
-
- protected String[] getBindingsFileNames() {
- return ArrayTools.array(this.bindingsFileNames.iterator(), new String[0]);
- }
-
- // ********** UI components **********
-
- private Text buildCatalogText(Composite parent) {
- Text text = new Text(parent, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 2;
- gridData.verticalIndent = 5;
- text.setLayoutData(gridData);
- return text;
- }
-
- private void buildBrowseButton(Composite parent) {
-
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
-
- // Browse buttons
- Button browseButton = new Button(buttonComposite, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_browseButton);
- gridData = new GridData();
- gridData.horizontalAlignment= GridData.FILL;
- gridData.verticalIndent = 5;
- gridData.grabExcessHorizontalSpace= true;
- browseButton.setLayoutData(gridData);
-
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String filePath = promptXmlFile();
- if( ! StringTools.stringIsEmpty(filePath)) {
-
- catalogText.setText(makeRelativeToProjectPath(filePath));
- }
- }
- });
- }
-
- private TableViewer buildBindingsFileTable(Composite parent) {
-
- TableViewer tableViewer = this.buildTableViewer(parent, this.bindingsFileNames);
-
- this.buildAddRemoveButtons(parent, tableViewer, this.bindingsFileNames);
- return tableViewer;
- }
-
- private TableViewer buildTableViewer(Composite parent, ArrayList<String> tableDataModel) {
-
- TableLayoutComposite tableLayout = new TableLayoutComposite(parent, SWT.NONE);
- this.addColumnsData(tableLayout);
-
- final Table table = new Table(tableLayout, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
- table.setLinesVisible(false);
-
- TableColumn column = new TableColumn(table, SWT.NONE, 0);
- column.setResizable(true);
-
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 2;
- gridData.heightHint= SWTUtil.getTableHeightHint(table, 3);
- tableLayout.setLayoutData(gridData);
-
- TableViewer tableViewer = new TableViewer(table);
- tableViewer.setUseHashlookup(true);
- tableViewer.setLabelProvider(this.buildLabelProvider());
- tableViewer.setContentProvider(this.buildContentProvider());
-
- tableViewer.setInput(tableDataModel);
- return tableViewer;
- }
-
- private void buildAddRemoveButtons(Composite parent, final TableViewer tableViewer, final ArrayList<String> tableDataModel) {
-
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
- // Add buttons
- Button addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_addButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- addButton.setLayoutData(gridData);
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- ArrayList<String> filePaths = promptBindingsFiles();
- for(String filePath : filePaths) {
- addBindingsFile(filePath, tableDataModel);
- }
- tableViewer.refresh();
- }
- });
- // Remove buttons
- Button removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_removeButton);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- removeButton.setLayoutData(gridData);
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- StructuredSelection selection = (StructuredSelection)tableViewer.getSelection();
- if(selection.isEmpty()) {
- return;
- }
- String bindingsFileName = (String)selection.getFirstElement();
- removeBindingsFile(bindingsFileName);
-
- tableViewer.refresh();
- }
- });
- addButton.setFocus();
- }
-
- // ********** internal methods **********
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(getJavaProject().getProject().getLocation());
- return relativePath.toOSString();
- }
-
- private void addBindingsFile(String filePath, final ArrayList<String> tableDataModel) {
- String relativePath = this.makeRelativeToProjectPath(filePath);
- if( ! tableDataModel.contains(relativePath)) {
- tableDataModel.add(relativePath);
- }
- }
-
- private void removeBindingsFile(String bindingsName) {
- this.bindingsFileNames.remove(bindingsName);
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new TableLabelProvider();
- }
-
- private IContentProvider buildContentProvider() {
- return new TableContentProvider();
- }
-
- /**
- * The Add button was clicked, its action invokes this action which should
- * prompt the user to select a file and return it.
- */
- private String promptXmlFile() {
- String projectPath= getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseACatalog);
- dialog.setFilterPath(projectPath);
- dialog.setFilterExtensions(new String[] {XML_FILTER});
-
- return dialog.open();
- }
-
- private ArrayList<String> promptBindingsFiles() {
- String projectPath= getJavaProject().getProject().getLocation().toString();
-
- FileDialog dialog = new FileDialog(getShell(), SWT.MULTI);
- dialog.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseABindingsFile);
- dialog.setFilterPath(projectPath);
- dialog.setFilterExtensions(new String[] {BINDINGS_FILE_FILTER});
-
- dialog.open();
- String path = dialog.getFilterPath();
- String[] fileNames = dialog.getFileNames();
- ArrayList<String> results = new ArrayList<String>(fileNames.length);
- for(String fileName : fileNames) {
- results.add(path + File.separator + fileName);
- }
- return results;
- }
-
- private void addColumnsData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- }
-
- // ********** inner class **********
- private class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- return (String)element;
- }
- }
-
- private class TableContentProvider implements IStructuredContentProvider {
-
- TableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java
deleted file mode 100644
index 57db24a58d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java
+++ /dev/null
@@ -1,190 +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.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-
-/**
- * SchemaWizardPage
- */
-public class SchemaWizardPage extends WizardPage {
-
- private final IStructuredSelection initialSelection;
- private IProject targetProject;
-
- protected SelectFileOrXMLCatalogIdPanel selectSourcePanel;
-
- protected static final String[] browseXSDFilterExtensions = {".xsd"}; //$NON-NLS-1$
-
- // ********** static method **********
-
- public static IFile getSourceSchemaFromSelection(IStructuredSelection selection) {
- Object firstElement = selection.getFirstElement();
- if(firstElement instanceof IFile) {
- String elementExtension = ((IFile)firstElement).getFileExtension();
- if(elementExtension != null) {
- if(browseXSDFilterExtensions[0].endsWith(elementExtension)) {
- return ((IFile)firstElement);
- }
- }
- }
- return null;
- }
-
- // ********** constructor **********
-
- SchemaWizardPage(IStructuredSelection selection) {
- super("SchemaWizardPage"); //$NON-NLS-1$
-
- this.initialSelection = selection;
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- this.setControl(composite);
-
- this.selectSourcePanel = new SelectFileOrXMLCatalogIdPanel(composite, this.initialSelection);
- this.selectSourcePanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SelectFileOrXMLCatalogIdPanel.PanelListener listener = new SelectFileOrXMLCatalogIdPanel.PanelListener() {
- public void completionStateChanged() {
- selectFileOrXMLCatalogIdPanelChanged();
- }
- };
- this.selectSourcePanel.setListener(listener);
- Dialog.applyDialogFont(parent);
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible) {
-
- if(this.getSourceSchema() != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.getSourceSchema()));
- }
- else {
- this.updateTargetProject();
- IFile schema = getSourceSchemaFromSelection(this.initialSelection);
- if(schema != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(schema));
- }
- else {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.targetProject));
- }
- }
- this.selectSourcePanel.update();
-
- this.setTitle(JptJaxbUiMessages.SchemaWizardPage_title);
- this.setDescription(JptJaxbUiMessages.SchemaWizardPage_desc);
- this.selectSourcePanel.setFilterExtensions(browseXSDFilterExtensions);
- }
- this.selectSourcePanel.setVisibleHelper(visible);
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
-
- return this.schemaOrUriSelected() && (this.getErrorMessage() == null);
- }
-
- // ********** intra-wizard methods **********
-
- public IFile getSourceSchema() {
- return this.selectSourcePanel.getFile();
- }
-
- public String getSourceURI() {
- String uri = this.selectSourcePanel.getXMLCatalogURI();
- if(uri == null) {
- IFile file = this.selectSourcePanel.getFile();
- if(file != null) {
- uri = URIHelper.getPlatformURI(file);
- }
- }
- return uri;
- }
-
- public String getXMLCatalogId() {
- return this.selectSourcePanel.getXMLCatalogId();
- }
-
- // ********** internal methods **********
-
- private void updateTargetProject() {
- IWizardPage previousPage = this.getPreviousPage();
-
- if(previousPage instanceof JavaProjectWizardPage) {
- // get project from previousPage
- this.targetProject = (((JavaProjectWizardPage)previousPage).getJavaProject()).getProject();
- }
- else if(initialSelection != null && ! this.initialSelection.isEmpty()) {
- // no previousPage - get project from initialSelection
- this.targetProject = this.getProjectFromInitialSelection();
- }
- }
-
- private IProject getProjectFromInitialSelection() {
- Object firstElement = initialSelection.getFirstElement();
- if(firstElement instanceof IProject) {
- return (IProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- return ((IResource) firstElement).getProject();
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject().getProject();
- }
- return null;
- }
-
- private boolean schemaOrUriSelected() {
- return ((this.getSourceSchema() != null) || (this.getSourceURI() != null));
- }
-
- private String computeErrorMessage() {
- String errorMessage = null;
- String uri = this.getSourceURI();
- if(uri != null) {
- if( ! URIHelper.isReadableURI(uri, false)) {
- errorMessage = JptJaxbUiMessages.SchemaWizardPage_errorUriCannotBeLocated;
- }
- }
- return errorMessage;
- }
-
- private void selectFileOrXMLCatalogIdPanelChanged() {
- String errorMessage = this.computeErrorMessage();
- this.setErrorMessage(errorMessage);
- this.setPageComplete(this.isPageComplete());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
deleted file mode 100644
index c7a6db1116..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-
-public class SelectFileOrXMLCatalogIdPanel extends Composite implements SelectionListener {
-
- public interface PanelListener {
- void completionStateChanged();
- }
-
- protected PanelListener listener;
- protected PageBook pageBook;
-
- protected Button[] radioButton;
- protected SelectFilePanel selectFilePanel;
- protected SelectXMLCatalogIdPanel selectXMLCatalogIdPanel;
-
- // ********** constructor **********
-
- public SelectFileOrXMLCatalogIdPanel(Composite parent, IStructuredSelection selection) {
- super(parent, SWT.NONE);
-
- // container group
- setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 400;
- gd.widthHint = 400;
- setLayoutData(gd);
-
- radioButton = new Button[2];
- radioButton[0] = new Button(this, SWT.RADIO);
- radioButton[0].setText("Select file from Workspace");
- radioButton[0].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[0].setSelection(true);
- radioButton[0].addSelectionListener(this);
-
- radioButton[1] = new Button(this, SWT.RADIO);
- radioButton[1].setText("Select XML Catalog entry");
- radioButton[1].setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- radioButton[1].addSelectionListener(this);
-
- pageBook = new PageBook(this, SWT.NONE);
- pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- selectFilePanel = new SelectFilePanel(pageBook, selection);
- this.setSingleFileViewDefaultSelection(selection);
-
- // Catalog
- ICatalog xmlCatalog = JptJaxbUiPlugin.instance().getDefaultXMLCatalog();
- selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
- selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateCompletionStateChange();
- }
- });
- Dialog.applyDialogFont(parent);
- pageBook.showPage(selectFilePanel.getControl());
- }
-
- public void setSingleFileViewDefaultSelection(ISelection selection) {
- this.selectFilePanel.setDefaultSelection(selection);
- }
-
- public IFile getFile() {
- IFile result = null;
- if (radioButton[0].getSelection()) {
- result = selectFilePanel.getFile();
- }
- return result;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getXMLCatalogEntry();
- }
- return result;
- }
-
- public String getXMLCatalogId() {
- String result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getId();
- }
- return result;
- }
-
- public String getXMLCatalogURI() {
- String result = null;
- if (radioButton[1].getSelection()) {
- result = selectXMLCatalogIdPanel.getURI();
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- selectXMLCatalogIdPanel.setCatalogEntryType(catalogEntryType);
- }
-
- public void setFilterExtensions(String[] filterExtensions) {
- selectFilePanel.resetFilters();
- selectFilePanel.addFilterExtensions(filterExtensions);
-
- selectXMLCatalogIdPanel.getTableViewer().setFilterExtensions(filterExtensions);
- }
-
- public void setListener(PanelListener listener) {
- this.listener = listener;
- }
-
- public void setVisibleHelper(boolean isVisible) {
- selectFilePanel.setVisibleHelper(isVisible);
- }
-
- public void updateCompletionStateChange() {
- if (listener != null) {
- listener.completionStateChanged();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public void widgetSelected(SelectionEvent e) {
- if (e.widget == radioButton[0]) {
- pageBook.showPage(selectFilePanel.getControl());
- }
- else {
- pageBook.showPage(selectXMLCatalogIdPanel);
- }
- updateCompletionStateChange();
- }
-
- // ********** inner class **********
-
- protected class SelectFilePanel extends SelectSingleFileViewFacade implements SelectSingleFileViewFacade.Listener {
- protected Control control;
-
- public SelectFilePanel(Composite parent, IStructuredSelection selection) {
- super(selection, true);
- // String[] ext = {".dtd"};
- // addFilterExtensions(ext);
- control = createControl(parent);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
- SelectFilePanel.this.setListener(this);
- }
-
- public Control getControl() {
- return control;
- }
-
- public void setControlComplete(boolean isComplete) {
- updateCompletionStateChange();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.java
deleted file mode 100644
index 888095e447..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectSingleFileViewFacade.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.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SelectSingleFileView
- *
- * Façade class to change accessibility of SelectSingleFileView.
- */
-public class SelectSingleFileViewFacade extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView {
-
- public static interface Listener extends org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.Listener
- {}
-
- public SelectSingleFileViewFacade(IStructuredSelection selection, boolean isFileMandatory) {
- super(selection, isFileMandatory);
- }
-
- public void addFilterExtensions(String[] filterExtensions) {
- super.addFilterExtensions(filterExtensions);
- }
-
- public Composite createControl(Composite parent) {
- return super.createControl(parent);
- }
-
- public IFile getFile() {
- return super.getFile();
- }
-
- public void resetFilters() {
- super.resetFilters();
- }
-
- public void setVisibleHelper(boolean isVisible) {
- super.setVisibleHelper(isVisible);
- }
-
- public void setDefaultSelection(ISelection selection) {
- super.setDefaultSelection(selection);
- }
-
- public void setListener(Listener listener) {
- super.setListener(listener);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
deleted file mode 100644
index 2745d0ab04..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.INextCatalog;
-
-
-public class SelectXMLCatalogIdPanel extends Composite {
- protected int catalogEntryType;
- protected boolean doTableSizeHack = false;
-
- protected XMLCatalogTableViewer tableViewer;
- protected ICatalog fXmlCatalog;
-
- public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
- super(parent, SWT.NONE);
- this.fXmlCatalog = xmlCatalog;
-
- GridLayout gridLayout = new GridLayout();
- this.setLayout(gridLayout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 200;
- gd.widthHint = 700;
- this.setLayoutData(gd);
-
- Label label = new Label(this, SWT.NONE);
- label.setText(JptJaxbUiMessages.SchemaWizardPage_xmlCatalogTableTitle);
-
- tableViewer = createTableViewer(this);
- tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- tableViewer.setInput("dummy"); //$NON-NLS-1$
- }
-
- protected XMLCatalogTableViewer createTableViewer(Composite parent) {
- String headings[] = new String[2];
- headings[0] = JptJaxbUiMessages.SchemaWizardPage_xmlCatalogKeyColumn;
- headings[1] = JptJaxbUiMessages.SchemaWizardPage_xmlCatalogUriColumn;
-
- XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
-
- protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
- for (int i = 0; i < entries.length; i++) {
- ICatalogEntry entry = entries[i];
- if (catalogEntryType == 0) {
- list.add(entry);
- }
- else if (catalogEntryType == entry.getEntryType()) {
- list.add(entry);
- }
- }
- }
-
- public Collection getXMLCatalogEntries() {
- List result = null;
-
- if ((fXmlCatalog == null) || doTableSizeHack) {
- // this lets us create a table with an initial height of
- // 10 rows
- // otherwise we get stuck with 0 row heigh table... that's
- // too small
- doTableSizeHack = false;
- result = new Vector();
- for (int i = 0; i < 6; i++) {
- result.add(""); //$NON-NLS-1$
- }
- }
- else {
- result = new Vector();
- INextCatalog[] nextCatalogs = fXmlCatalog.getNextCatalogs();
- for (int i = 0; i < nextCatalogs.length; i++) {
- INextCatalog catalog = nextCatalogs[i];
- ICatalog referencedCatalog = catalog.getReferencedCatalog();
- if (referencedCatalog != null) {
- if (JptJaxbUiPlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog systemCatalog = referencedCatalog;
- addXMLCatalogEntries(result, systemCatalog.getCatalogEntries());
-
- }
- else if (JptJaxbUiPlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
- ICatalog userCatalog = referencedCatalog;
- addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
-
- }
- }
- }
- }
- return result;
- }
- };
- return theTableViewer;
- }
-
-
- public String getId() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getKey() : null;
- }
-
- public XMLCatalogTableViewer getTableViewer() {
- return tableViewer;
- }
-
- public String getURI() {
- ICatalogEntry entry = getXMLCatalogEntry();
- return entry != null ? entry.getURI() : null;
- }
-
- public ICatalogEntry getXMLCatalogEntry() {
- ICatalogEntry result = null;
- ISelection selection = tableViewer.getSelection();
- Object selectedObject = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).getFirstElement() : null;
- if (selectedObject instanceof ICatalogEntry) {
- result = (ICatalogEntry) selectedObject;
- }
- return result;
- }
-
- public void setCatalogEntryType(int catalogEntryType) {
- this.catalogEntryType = catalogEntryType;
- tableViewer.refresh();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
deleted file mode 100644
index 4a24f1c36b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.wst.xml.ui.internal.dialogs
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
-import com.ibm.icu.text.Collator;
-
-public class XMLCatalogTableViewer extends TableViewer {
-
- protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
-
- protected static Image dtdFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/dtdfile.gif"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/text.gif"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptJaxbUiPlugin.getImage("icons/full/obj16/XSDFile.gif"); //$NON-NLS-1$
- protected static Image errorImage = JptJaxbUiPlugin.getImage("icons/full/ovr16/error_ovr.gif"); //$NON-NLS-1$
-
- // ********** constructor **********
-
- public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
- super(parent, SWT.FULL_SELECTION);
-
- Table table = getTable();
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableLayout layout = new TableLayout();
- for (int i = 0; i < columnProperties.length; i++) {
- TableColumn column = new TableColumn(table, i);
- column.setText(columnProperties[i]);
- column.setAlignment(SWT.LEFT);
- layout.addColumnData(new ColumnWeightData(50, true));
- }
- table.setLayout(layout);
- table.setLinesVisible(false);
-
- setColumnProperties(columnProperties);
-
- setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
- }
-
- public Collection getXMLCatalogEntries() {
- return null;
- }
-
- public void menuAboutToShow(IMenuManager menuManager) {
- Action action = new Action("hello") { //$NON-NLS-1$
- public void run() {
- System.out.println("run!"); //$NON-NLS-1$
- }
- };
- menuManager.add(action);
- }
-
- public void setFilterExtensions(String[] extensions) {
- resetFilters();
- addFilter(new XMLCatalogTableViewerFilter(extensions));
- }
-
- // ********** inner class **********
-
- public class CatalogEntryContentProvider implements IStructuredContentProvider {
-
- public void dispose() {
- }
-
- public Object[] getElements(Object element) {
- Object[] array = getXMLCatalogEntries().toArray();
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- int result = 0;
- if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) {
- ICatalogEntry mappingInfo1 = (ICatalogEntry) o1;
- ICatalogEntry mappingInfo2 = (ICatalogEntry) o2;
- result = Collator.getInstance().compare(mappingInfo1.getKey(), mappingInfo2.getKey());
- }
- return result;
- }
- };
- Arrays.sort(array, comparator);
- return array;
- }
-
- public void inputChanged(Viewer viewer, Object old, Object newobj) {
- }
-
- public boolean isDeleted(Object object) {
- return false;
- }
- }
-
- public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- if (columnIndex == 0) {
- Image base = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- if (uri.endsWith("dtd")) { //$NON-NLS-1$
- base = dtdFileImage;
- }
- else if (uri.endsWith("xsd")) { //$NON-NLS-1$
- base = xsdFileImage;
- }
- else {
- base = unknownFileImage;
- }
-
- if (base != null) {
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- // TODO... SSE port
- result = base;// imageFactory.createCompositeImage(base,
- // errorImage,
- // ImageFactory.BOTTOM_LEFT);
- }
- }
- }
- }
- return result;
- }
-
- public String getColumnText(Object object, int columnIndex) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
- result = URIHelper.removePlatformResourceProtocol(result);
- }
- return result != null ? result : ""; //$NON-NLS-1$
- }
- }
-
- class XMLCatalogTableViewerFilter extends ViewerFilter {
- protected String[] extensions;
-
- public XMLCatalogTableViewerFilter(String[] extensions) {
- this.extensions = extensions;
- }
-
- public boolean isFilterProperty(Object element, Object property) {
- return false;
- }
-
- public boolean select(Viewer viewer, Object parent, Object element) {
- boolean result = false;
- if (element instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) element;
- for (int i = 0; i < extensions.length; i++) {
- if (catalogEntry.getURI().endsWith(extensions[i])) {
- result = true;
- break;
- }
- }
- }
- return result;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java
deleted file mode 100644
index 23526b7272..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java
+++ /dev/null
@@ -1,21 +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.ui.internal.wizards.facet;
-
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProperties;
-
-public class JaxbFacetInstallPage
- extends JaxbFacetPage
- implements JaxbFacetInstallDataModelProperties {
-
- public JaxbFacetInstallPage() {
- super("jpt.jaxb.facet.install.page");
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
deleted file mode 100644
index 861dae7f92..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
+++ /dev/null
@@ -1,178 +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.ui.internal.wizards.facet;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetDataModelProperties;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
-
-
-public abstract class JaxbFacetPage
- extends DataModelFacetInstallPage
- implements JaxbFacetDataModelProperties {
-
- protected JaxbFacetPage(String pageName) {
- super(pageName);
- setTitle(JptJaxbUiMessages.JaxbFacetWizardPage_title);
- setDescription(JptJaxbUiMessages.JaxbFacetWizardPage_desc);
- setImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER));
- }
-
-
- @Override
- public void setConfig(Object config) {
- if (! (config instanceof IDataModel)) {
- config = Platform.getAdapterManager().loadAdapter(config, IDataModel.class.getName());
- }
- super.setConfig(config);
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- addSubComposites(composite);
-
- Dialog.applyDialogFont(parent);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, JpaHelpContextIds.DIALOG_JPA_FACET);
-
- return composite;
- }
-
- protected void addSubComposites(Composite composite) {
- new PlatformGroup(composite);
- new ClasspathConfigGroup(composite);
- }
-
- protected Button createButton(Composite container, int span, String text, int style) {
- Button button = new Button(container, SWT.NONE | style);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- button.setLayoutData(gd);
- return button;
- }
-
- protected Combo createCombo(Composite container, int span, boolean fillHorizontal) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd;
- if (fillHorizontal) {
- gd = new GridData(GridData.FILL_HORIZONTAL);
- }
- else {
- gd = new GridData();
- }
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- PLATFORM,
- LIBRARY_INSTALL_DELEGATE
- };
- }
-
- @Override
- public boolean isPageComplete() {
- if (! super.isPageComplete()) {
- return false;
- }
- else {
- IStatus status = this.model.validate();
- if (status.getSeverity() == IStatus.ERROR) {
- setErrorMessage(status.getMessage());
- return false;
- };
- setErrorMessage(null);
- return true;
- }
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- setErrorMessage();
- }
- }
-
- @Override
- public void transferStateToConfig() {
- // This method is called when "finish" is being performed.
- // We remove "this" as a listener so that it will stop responding to data model changes.
- // "This" listens only for validation purposes, and we are done with validation at this
- // point. Furthermore, any validation at this point runs into the danger of deadlocking
- // the wizard.
- this.model.removeListener(this);
- this.synchHelper.dispose();
- super.transferStateToConfig();
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
-
- protected final class PlatformGroup
- {
- private final Combo platformCombo;
-
-
- public PlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptJaxbUiMessages.JaxbFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.DIALOG_JPA_PLATFORM);
-
- this.platformCombo = createCombo(group, 1, true);
- JaxbFacetPage.this.synchHelper.synchCombo(platformCombo, PLATFORM, null);
- }
- }
-
-
- protected final class ClasspathConfigGroup {
-
- public ClasspathConfigGroup(Composite composite) {
-
- LibraryInstallDelegate librariesInstallDelegate
- = (LibraryInstallDelegate) getDataModel().getProperty(LIBRARY_INSTALL_DELEGATE);
-
- Composite librariesComposite
- = (Composite) LibraryProviderFrameworkUi.createInstallLibraryPanel(
- composite, librariesInstallDelegate,
- JptJaxbUiMessages.JaxbFacetWizardPage_jaxbImplementationLabel);
- librariesComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(librariesComposite, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java
deleted file mode 100644
index 26e1e43b0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java
+++ /dev/null
@@ -1,21 +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.ui.internal.wizards.facet;
-
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProperties;
-
-public class JaxbFacetVersionChangePage
- extends JaxbFacetPage
- implements JaxbFacetVersionChangeDataModelProperties {
-
- public JaxbFacetVersionChangePage() {
- super("jpt.jaxb.facet.versionChange.page");
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java
deleted file mode 100644
index 696d4cee32..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.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.ui.internal.wizards.proj;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.proj.model.JaxbProjectCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
-
-
-public class JaxbProjectWizard
- extends NewProjectDataModelFacetWizard {
-
- public JaxbProjectWizard() {
- super();
- setWindowTitle(JptJaxbUiMessages.JaxbProjectWizard_title);
- }
-
- public JaxbProjectWizard(IDataModel dataModel) {
- super(dataModel);
- setWindowTitle(JptJaxbUiMessages.JaxbProjectWizard_title);
- }
-
-
- @Override
- protected ImageDescriptor getDefaultPageImageDescriptor() {
- return JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.JAXB_WIZ_BANNER);
- }
-
- @Override
- protected IWizardPage createFirstPage() {
- return new JaxbProjectWizardFirstPage(model, "first.page"); //$NON-NLS-1$
- }
-
- @Override
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new JaxbProjectCreationDataModelProvider());
- }
-
- @Override
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("jpt.jaxb.template");
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java
deleted file mode 100644
index 1a1ec07af8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizardFirstPage.java
+++ /dev/null
@@ -1,90 +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.ui.internal.wizards.proj;
-
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
-
-
-public class JaxbProjectWizardFirstPage
- extends DataModelFacetCreationWizardPage {
-
- public JaxbProjectWizardFirstPage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- setTitle(JptJaxbUiMessages.JaxbProjectWizard_firstPage_title);
- setDescription(JptJaxbUiMessages.JaxbProjectWizard_firstPage_desc);
- //setInfopopID(JpaJaxbHelpContextIds.NEW_JAXB_PROJECT);
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- final Composite top = super.createTopLevelComposite(parent);
- createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET, JAVA_WORKING_SET });
- return top;
- }
-
-// @Override
-// public boolean internalLaunchNewRuntimeWizard(Shell shell, IDataModel model) {
-// IFacetedProjectWorkingCopy fpwc = (IFacetedProjectWorkingCopy) model.getProperty(FACETED_PROJECT_WORKING_COPY);
-// IProjectFacetVersion moduleFacet = FacetTools.getModuleFacet(fpwc);
-// if (moduleFacet != null) {
-// return launchNewRuntimeWizard(shell, model, moduleFacet.getProjectFacet().getId());
-// }
-// else {
-// return launchNewRuntimeWizard(shell, model);
-// }
-// }
-
- @Override
- protected String getModuleTypeID() {
- return JaxbFacet.ID;
- }
-
- @Override
- public void storeDefaultSettings() {
- super.storeDefaultSettings();
- // TODO
-// IDialogSettings settings = getDialogSettings();
-// if (settings != null) {
-// FacetDataModelMap map = (FacetDataModelMap)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
-// String facetID = getModuleFacetID();
-// IDataModel j2eeModel = map.getFacetDataModel(facetID);
-// if(j2eeModel.getBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR)){
-// String lastEARName = j2eeModel.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
-// settings.put(STORE_LABEL, lastEARName);
-// }
-// }
- }
-
- @Override
- public void restoreDefaultSettings() {
- super.restoreDefaultSettings();
- // TODO
-// IDialogSettings settings = getDialogSettings();
-// if (settings != null) {
-// String lastEARName = settings.get(STORE_LABEL);
-// if (lastEARName != null){
-// FacetDataModelMap map = (FacetDataModelMap)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
-// String facetID = getModuleFacetID();
-// IDataModel j2eeModel = map.getFacetDataModel(facetID);
-// j2eeModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.LAST_EAR_NAME, lastEARName);
-// }
-// }
- }
-
-// @Override
-// protected IDialogSettings getDialogSettings() {
-// return J2EEUIPlugin.getDefault().getDialogSettings();
-// }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java
deleted file mode 100644
index 76747b04ab..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/model/JaxbProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,39 +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.ui.internal.wizards.proj.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-
-
-public class JaxbProjectCreationDataModelProvider
- extends FacetProjectCreationDataModelProvider
- implements IFacetProjectCreationDataModelProperties {
-
- public JaxbProjectCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public void init() {
- super.init();
-
- Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
- requiredFacets.add(JavaFacet.FACET);
- requiredFacets.add(JaxbFacet.FACET);
- setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java
deleted file mode 100644
index b703e1c3bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.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.ui.internal.wizards.schemagen;
-
-import org.eclipse.jdt.ui.jarpackager.JarPackageData;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Façade class to change accessibility of AbstractJarDestinationWizardPage.
- */
-@SuppressWarnings("restriction")
-public abstract class AbstractJarDestinationWizardPage extends org.eclipse.jdt.internal.ui.jarpackager.AbstractJarDestinationWizardPage
-{
-
- public AbstractJarDestinationWizardPage(String pageName, IStructuredSelection selection, JarPackageData jarPackage) {
- super(pageName, selection, jarPackage);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java
deleted file mode 100644
index e551a5e32f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java
+++ /dev/null
@@ -1,856 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms 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
- * Code originate from org.eclipse.jdt.internal.ui.jarpackager
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Combines a CheckboxTreeViewer and CheckboxListViewer.
- * All viewer selection-driven interactions are handled within this viewer
- */
-public class CheckboxTreeAndListGroup implements ICheckStateListener, ISelectionChangedListener, ITreeViewerListener {
-
- private Object fRoot;
- private Object fCurrentTreeSelection;
- private List fExpandedTreeNodes= new ArrayList();
- private Map fCheckedStateStore= this.buildCheckedStateStore();
- private List fWhiteCheckedTreeItems= new ArrayList();
- private List fListeners= new ArrayList();
-
- private ITreeContentProvider fTreeContentProvider;
- private IStructuredContentProvider fListContentProvider;
- private ILabelProvider fTreeLabelProvider;
- private ILabelProvider fListLabelProvider;
-
- // widgets
- private CheckboxTreeViewer fTreeViewer;
- private CheckboxTableViewer fListViewer;
-
- /**
- * Creates an instance of this class. Use this constructor if you wish to specify
- * the width and/or height of the combined widget (to only hardcode one of the
- * sizing dimensions, specify the other dimension's value as -1)
- * @param parent parent composite
- * @param rootObject
- * @param treeContentProvider
- * @param treeLabelProvider
- * @param listContentProvider
- * @param listLabelProvider
- * @param style
- * @param width the width
- * @param height the height
- */
- public CheckboxTreeAndListGroup(
- Composite parent,
- Object rootObject,
- ITreeContentProvider treeContentProvider,
- ILabelProvider treeLabelProvider,
- IStructuredContentProvider listContentProvider,
- ILabelProvider listLabelProvider,
- int style,
- int width,
- int height) {
- fRoot= rootObject;
- fTreeContentProvider= treeContentProvider;
- fListContentProvider= listContentProvider;
- fTreeLabelProvider= treeLabelProvider;
- fListLabelProvider= listLabelProvider;
- createContents(parent, width, height, style);
- }
- /**
- * This method must be called just before this window becomes visible.
- */
- public void aboutToOpen() {
- determineWhiteCheckedDescendents(fRoot);
- checkNewTreeElements(getTreeChildren(fRoot));
- fCurrentTreeSelection= null;
-
- //select the first element in the list
- Object[] elements= getTreeChildren(fRoot);
- Object primary= elements.length > 0 ? elements[0] : null;
- if (primary != null) {
- fTreeViewer.setSelection(new StructuredSelection(primary));
- }
- fTreeViewer.getControl().setFocus();
- }
- /**
- * Adds the passed listener to self's collection of clients
- * that listen for changes to element checked states
- *
- * @param listener ICheckStateListener
- */
- public void addCheckStateListener(ICheckStateListener listener) {
- fListeners.add(listener);
- }
- /**
- * Adds the receiver and all of it's ancestors to the checkedStateStore if they
- * are not already there.
- * @param treeElement
- */
- private void addToHierarchyToCheckedStore(Object treeElement) {
-
- // if this tree element is already gray then its ancestors all are as well
- if (!fCheckedStateStore.containsKey(treeElement))
- fCheckedStateStore.put(treeElement, new ArrayList());
-
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null)
- addToHierarchyToCheckedStore(parent);
- }
- /**
- * Returns a boolean indicating whether all children of the passed tree element
- * are currently white-checked
- *
- * @return boolean
- * @param treeElement java.lang.Object
- */
- protected boolean areAllChildrenWhiteChecked(Object treeElement) {
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i) {
- if (!fWhiteCheckedTreeItems.contains(children[i]))
- return false;
- }
-
- return true;
- }
- /**
- * Returns a boolean indicating whether all list elements associated with
- * the passed tree element are currently checked
- *
- * @return boolean
- * @param treeElement java.lang.Object
- */
- protected boolean areAllElementsChecked(Object treeElement) {
- List checkedElements= (List)fCheckedStateStore.get(treeElement);
- if (checkedElements == null) // ie.- tree item not even gray-checked
- return false;
-
- return getListItemsSize(treeElement) == checkedElements.size();
- }
- /**
- * Iterates through the passed elements which are being realized for the first
- * time and check each one in the tree viewer as appropriate
- * @param elements
- */
- protected void checkNewTreeElements(Object[] elements) {
- for (int i= 0; i < elements.length; ++i) {
- Object currentElement= elements[i];
- boolean checked= fCheckedStateStore.containsKey(currentElement);
- fTreeViewer.setChecked(currentElement, checked);
- fTreeViewer.setGrayed(
- currentElement,
- checked && !fWhiteCheckedTreeItems.contains(currentElement));
- }
- }
- /**
- * An item was checked in one of self's two views. Determine which
- * view this occurred in and delegate appropriately
- *
- * @param event CheckStateChangedEvent
- */
- public void checkStateChanged(final CheckStateChangedEvent event) {
-
- //Potentially long operation - show a busy cursor
- BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- if (event.getCheckable().equals(fTreeViewer))
- treeItemChecked(event.getElement(), event.getChecked());
- else
- listItemChecked(event.getElement(), event.getChecked(), true);
-
- notifyCheckStateChangeListeners(event);
- }
- });
- }
- /**
- * Lay out and initialize self's visual components.
- *
- * @param parent org.eclipse.swt.widgets.Composite
- * @param width int
- * @param height int
- * @param style
- */
- protected void createContents(
- Composite parent,
- int width,
- int height,
- int style) {
- // group pane
- Composite composite= new Composite(parent, style);
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- layout.makeColumnsEqualWidth= true;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- createTreeViewer(composite, width / 2, height);
- createListViewer(composite, width / 2, height);
-
- initialize();
- }
- /**
- * Creates this group's list viewer.
- * @param parent the parent composite
- * @param width the width
- * @param height the height
- */
- protected void createListViewer(Composite parent, int width, int height) {
- fListViewer= CheckboxTableViewer.newCheckList(parent, SWT.BORDER);
- fListViewer.setUseHashlookup(true);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.widthHint= width;
- data.heightHint= height;
- fListViewer.getTable().setLayoutData(data);
- fListViewer.setContentProvider(fListContentProvider);
- fListViewer.setLabelProvider(fListLabelProvider);
- fListViewer.addCheckStateListener(this);
- }
- /**
- * Creates this group's tree viewer.
- * @param parent parent composite
- * @param width the width
- * @param height the height
- */
- protected void createTreeViewer(Composite parent, int width, int height) {
- Tree tree= new Tree(parent, SWT.CHECK | SWT.BORDER);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.widthHint= width;
- data.heightHint= height;
- tree.setLayoutData(data);
-
- fTreeViewer= new CheckboxTreeViewer(tree);
- fTreeViewer.setUseHashlookup(true);
- fTreeViewer.setContentProvider(fTreeContentProvider);
- fTreeViewer.setLabelProvider(fTreeLabelProvider);
- fTreeViewer.addTreeListener(this);
- fTreeViewer.addCheckStateListener(this);
- fTreeViewer.addSelectionChangedListener(this);
- }
- /**
- * Returns a boolean indicating whether the passed tree element should be
- * at LEAST gray-checked. Note that this method does not consider whether
- * it should be white-checked, so a specified tree item which should be
- * white-checked will result in a <code>true</code> answer from this method.
- * To determine whether a tree item should be white-checked use method
- * #determineShouldBeWhiteChecked(Object).
- *
- * @param treeElement java.lang.Object
- * @return boolean
- * @see #determineShouldBeWhiteChecked(java.lang.Object)
- */
- protected boolean determineShouldBeAtLeastGrayChecked(Object treeElement) {
- // if any list items associated with treeElement are checked then it
- // retains its gray-checked status regardless of its children
- List checked= (List) fCheckedStateStore.get(treeElement);
- if (checked != null && (!checked.isEmpty()))
- return true;
-
- // if any children of treeElement are still gray-checked then treeElement
- // must remain gray-checked as well
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i) {
- if (fCheckedStateStore.containsKey(children[i]))
- return true;
- }
-
- return false;
- }
- /**
- * Returns a boolean indicating whether the passed tree item should be
- * white-checked.
- *
- * @return boolean
- * @param treeElement java.lang.Object
- */
- protected boolean determineShouldBeWhiteChecked(Object treeElement) {
- return areAllChildrenWhiteChecked(treeElement)
- && areAllElementsChecked(treeElement);
- }
- /**
- * Recursively adds appropriate tree elements to the collection of
- * known white-checked tree elements.
- *
- * @param treeElement java.lang.Object
- */
- protected void determineWhiteCheckedDescendents(Object treeElement) {
- // always go through all children first since their white-checked
- // statuses will be needed to determine the white-checked status for
- // this tree element
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i)
- determineWhiteCheckedDescendents(children[i]);
-
- // now determine the white-checked status for this tree element
- if (determineShouldBeWhiteChecked(treeElement))
- setWhiteChecked(treeElement, true);
- }
- /**
- * Causes the tree viewer to expand all its items
- */
- public void expandAll() {
- fTreeViewer.expandAll();
- }
- /**
- * Answers a flat collection of all of the checked elements in the
- * list portion of self
- *
- * @return java.util.Vector
- */
- public Iterator getAllCheckedListItems() {
- Set result= new HashSet();
- Iterator listCollectionsEnum= this.fCheckedStateStore.values().iterator();
- while (listCollectionsEnum.hasNext())
- result.addAll((List)listCollectionsEnum.next());
- return result.iterator();
- }
- /**
- * Answer a collection of all of the checked elements in the tree portion
- * of self
- *
- * @return java.util.Vector
- */
- public Set getAllCheckedTreeItems() {
- return new HashSet(fCheckedStateStore.keySet());
- }
- /**
- * Answers the number of elements that have been checked by the
- * user.
- *
- * @return int
- */
- public int getCheckedElementCount() {
- return fCheckedStateStore.size();
- }
- /**
- * Returns a count of the number of list items associated with a
- * given tree item.
- *
- * @return int
- * @param treeElement java.lang.Object
- */
- protected int getListItemsSize(Object treeElement) {
- Object[] elements= getListElements(treeElement);
- return elements.length;
- }
- /**
- * Gets the table that displays the folder content
- *
- * @return the table used to show the list
- */
- public Table getTable() {
- return fListViewer.getTable();
- }
- /**
- * Gets the tree that displays the list for a folder
- *
- * @return the tree used to show the folders
- */
- public Tree getTree() {
- return fTreeViewer.getTree();
- }
- /**
- * Adds the given filter to the tree viewer and
- * triggers refiltering and resorting of the elements.
- *
- * @param filter a viewer filter
- */
- public void addTreeFilter(ViewerFilter filter) {
- fTreeViewer.addFilter(filter);
- }
-
- public void removeTreeFilter(ViewerFilter filter) {
- fTreeViewer.removeFilter(filter);
- }
-
- /**
- * Adds the given filter to the list viewer and
- * triggers refiltering and resorting of the elements.
- *
- * @param filter a viewer filter
- */
- public void addListFilter(ViewerFilter filter) {
- fListViewer.addFilter(filter);
- }
-
- /**
- * Logically gray-check all ancestors of treeItem by ensuring that they
- * appear in the checked table
- * @param treeElement
- */
- protected void grayCheckHierarchy(Object treeElement) {
-
- // if this tree element is already gray then its ancestors all are as well
- if (fCheckedStateStore.containsKey(treeElement))
- return; // no need to proceed upwards from here
-
- fCheckedStateStore.put(treeElement, new ArrayList());
- if (determineShouldBeWhiteChecked(treeElement)) {
- setWhiteChecked(treeElement, true);
- }
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null)
- grayCheckHierarchy(parent);
- }
- /**
- * Sets the initial checked state of the passed list element to true.
- * @param element
- */
- public void initialCheckListItem(Object element) {
- Object parent= fTreeContentProvider.getParent(element);
- fCurrentTreeSelection= parent;
- //As this is not done from the UI then set the box for updating from the selection to false
- listItemChecked(element, true, false);
- updateHierarchy(parent);
- }
- /**
- * Sets the initial checked state of the passed element to true,
- * as well as to all of its children and associated list elements
- * @param element
- */
- public void initialCheckTreeItem(Object element) {
- treeItemChecked(element, true);
- }
- /**
- * Initializes this group's viewers after they have been laid out.
- */
- protected void initialize() {
- fTreeViewer.setInput(fRoot);
- }
- /**
- * Callback that's invoked when the checked status of an item in the list
- * is changed by the user. Do not try and update the hierarchy if we are building the
- * initial list.
- * @param listElement
- * @param state
- * @param updatingFromSelection
- */
- protected void listItemChecked(
- Object listElement,
- boolean state,
- boolean updatingFromSelection) {
- List checkedListItems= (List) fCheckedStateStore.get(fCurrentTreeSelection);
-
- if (state) {
- if (checkedListItems == null) {
- // since the associated tree item has gone from 0 -> 1 checked
- // list items, tree checking may need to be updated
- grayCheckHierarchy(fCurrentTreeSelection);
- checkedListItems= (List) fCheckedStateStore.get(fCurrentTreeSelection);
- }
- checkedListItems.add(listElement);
- } else {
- checkedListItems.remove(listElement);
- if (checkedListItems.isEmpty()) {
- // since the associated tree item has gone from 1 -> 0 checked
- // list items, tree checking may need to be updated
- ungrayCheckHierarchy(fCurrentTreeSelection);
- }
- }
-
- if (updatingFromSelection)
- updateHierarchy(fCurrentTreeSelection);
- }
- /**
- * Notifies all checked state listeners that the passed element has had
- * its checked state changed to the passed state
- * @param event
- */
- protected void notifyCheckStateChangeListeners(CheckStateChangedEvent event) {
- Iterator listenersEnum= fListeners.iterator();
- while (listenersEnum.hasNext())
- ((ICheckStateListener) listenersEnum.next()).checkStateChanged(event);
- }
- /**
- *Sets the contents of the list viewer based upon the specified selected
- *tree element. This also includes checking the appropriate list items.
- *
- *@param treeElement java.lang.Object
- */
- public void populateListViewer(final Object treeElement) {
- if (treeElement == fCurrentTreeSelection)
- return;
- fCurrentTreeSelection= treeElement;
- fListViewer.setInput(treeElement);
- List listItemsToCheck= (List) fCheckedStateStore.get(treeElement);
-
- if (listItemsToCheck != null) {
- Iterator listItemsEnum= listItemsToCheck.iterator();
- while (listItemsEnum.hasNext())
- fListViewer.setChecked(listItemsEnum.next(), true);
- }
- }
- /**
- * Removes the passed listener from self's collection of clients
- * that listen for changes to element checked states
- *
- * @param listener ICheckStateListener
- */
- public void removeCheckStateListener(ICheckStateListener listener) {
- fListeners.remove(listener);
- }
- /**
- * Handles the selection of an item in the tree viewer
- *
- * @param event ISelection
- */
- public void selectionChanged(final SelectionChangedEvent event) {
- BusyIndicator.showWhile(getTable().getShell().getDisplay(), new Runnable() {
- public void run() {
- IStructuredSelection selection= (IStructuredSelection) event.getSelection();
- Object selectedElement= selection.getFirstElement();
- if (selectedElement == null) {
- fCurrentTreeSelection= null;
- fListViewer.setInput(fCurrentTreeSelection);
- return;
- }
- populateListViewer(selectedElement);
- }
- });
- }
-
- /**
- * Selects or deselect all of the elements in the tree depending on the value of the selection
- * boolean. Be sure to update the displayed files as well.
- * @param selection
- */
- public void setAllSelections(final boolean selection) {
-
- //Potentially long operation - show a busy cursor
- BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- setTreeChecked(fRoot, selection);
- fListViewer.setAllChecked(selection);
- }
- });
- }
-
- /**
- * Sets the list viewer's providers to those passed
- *
- * @param contentProvider ITreeContentProvider
- * @param labelProvider ILabelProvider
- */
- public void setListProviders(
- IStructuredContentProvider contentProvider,
- ILabelProvider labelProvider) {
- fListViewer.setContentProvider(contentProvider);
- fListViewer.setLabelProvider(labelProvider);
- }
- /**
- * Sets the sorter that is to be applied to self's list viewer
- * @param comparator
- */
- public void setListComparator(ViewerComparator comparator) {
- fListViewer.setComparator(comparator);
- }
- /**
- * Sets the root of the widget to be new Root. Regenerate all of the tables and lists from this
- * value.
- *
- * @param newRoot
- */
- public void setRoot(Object newRoot) {
- this.fRoot= newRoot;
- initialize();
- }
- /**
- * Sets the checked state of the passed tree element appropriately, and
- * do so recursively to all of its child tree elements as well
- * @param treeElement
- * @param state
- */
- protected void setTreeChecked(Object treeElement, boolean state) {
-
- if (treeElement.equals(fCurrentTreeSelection)) {
- fListViewer.setAllChecked(state);
- }
-
- if (state) {
- Object[] listItems= getListElements(treeElement);
- List listItemsChecked= new ArrayList();
- for (int i= 0; i < listItems.length; ++i)
- listItemsChecked.add(listItems[i]);
-
- fCheckedStateStore.put(treeElement, listItemsChecked);
- } else
- fCheckedStateStore.remove(treeElement);
-
- setWhiteChecked(treeElement, state);
- fTreeViewer.setChecked(treeElement, state);
- fTreeViewer.setGrayed(treeElement, false);
-
- // now logically check/uncheck all children as well
- Object[] children= getTreeChildren(treeElement);
- for (int i= 0; i < children.length; ++i) {
- setTreeChecked(children[i], state);
- }
- }
- /**
- * Sets the tree viewer's providers to those passed
- *
- * @param contentProvider ITreeContentProvider
- * @param labelProvider ILabelProvider
- */
- public void setTreeProviders(
- ITreeContentProvider contentProvider,
- ILabelProvider labelProvider) {
- fTreeViewer.setContentProvider(contentProvider);
- fTreeViewer.setLabelProvider(labelProvider);
- }
- /**
- * Sets the sorter that is to be applied to self's tree viewer
- * @param sorter
- */
- public void setTreeComparator(ViewerComparator sorter) {
- fTreeViewer.setComparator(sorter);
- }
- /**
- * Adjusts the collection of references to white-checked tree elements appropriately.
- *
- * @param treeElement java.lang.Object
- * @param isWhiteChecked boolean
- */
- protected void setWhiteChecked(Object treeElement, boolean isWhiteChecked) {
- if (isWhiteChecked) {
- if (!fWhiteCheckedTreeItems.contains(treeElement))
- fWhiteCheckedTreeItems.add(treeElement);
- } else
- fWhiteCheckedTreeItems.remove(treeElement);
- }
- /**
- * Handle the collapsing of an element in a tree viewer
- * @param event
- */
- public void treeCollapsed(TreeExpansionEvent event) {
- // We don't need to do anything with this
- }
-
- /**
- * Handles the expansionsion of an element in a tree viewer
- * @param event
- */
- public void treeExpanded(TreeExpansionEvent event) {
-
- Object item= event.getElement();
-
- // First see if the children need to be given their checked state at all. If they've
- // already been realized then this won't be necessary
- if (!fExpandedTreeNodes.contains(item)) {
- fExpandedTreeNodes.add(item);
- checkNewTreeElements(getTreeChildren(item));
- }
- }
-
- /**
- * Callback that's invoked when the checked status of an item in the tree
- * is changed by the user.
- * @param treeElement
- * @param state
- */
- protected void treeItemChecked(Object treeElement, boolean state) {
-
- // recursively adjust all child tree elements appropriately
- setTreeChecked(treeElement, state);
-
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent == null)
- return;
-
- // now update upwards in the tree hierarchy
- if (state)
- grayCheckHierarchy(parent);
- else
- ungrayCheckHierarchy(parent);
-
- updateHierarchy(treeElement);
- }
- /**
- * Logically un-gray-check all ancestors of treeItem iff appropriate.
- * @param treeElement
- */
- protected void ungrayCheckHierarchy(Object treeElement) {
- if (!determineShouldBeAtLeastGrayChecked(treeElement))
- fCheckedStateStore.remove(treeElement);
-
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null)
- ungrayCheckHierarchy(parent);
- }
- /**
- * Sets the checked state of self and all ancestors appropriately
- * @param treeElement
- */
- protected void updateHierarchy(Object treeElement) {
-
- boolean whiteChecked= determineShouldBeWhiteChecked(treeElement);
- boolean shouldBeAtLeastGray= determineShouldBeAtLeastGrayChecked(treeElement);
-
- fTreeViewer.setChecked(treeElement, whiteChecked || shouldBeAtLeastGray);
- setWhiteChecked(treeElement, whiteChecked);
- if (whiteChecked)
- fTreeViewer.setGrayed(treeElement, false);
- else
- fTreeViewer.setGrayed(treeElement, shouldBeAtLeastGray);
-
- // proceed up the tree element hierarchy
- Object parent= fTreeContentProvider.getParent(treeElement);
- if (parent != null) {
- updateHierarchy(parent);
- }
- }
- /**
- * Update the selections of the tree elements in items to reflect the new
- * selections provided.
- *
- * @param items with keys of Object (the tree element) and values of List (the selected
- * list elements).
- */
- public void updateSelections(final Map items) {
-
- //Potentially long operation - show a busy cursor
- BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- handleUpdateSelection(items);
- }
- });
- }
- /**
- * Returns the result of running the given elements through the filters.
- * @param filters
- *
- * @param elements the elements to filter
- * @return only the elements which all filters accept
- */
- protected Object[] filter(ViewerFilter[] filters, Object[] elements) {
- if (filters != null) {
- ArrayList filtered = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- boolean add = true;
- for (int j = 0; j < filters.length; j++) {
- add = filters[j].select(null, null, elements[i]);
- if (!add)
- break;
- }
- if (add)
- filtered.add(elements[i]);
- }
- return filtered.toArray();
- }
- return elements;
- }
-
- private Object[] getTreeChildren(Object element) {
- return filter(fTreeViewer.getFilters(), fTreeContentProvider.getChildren(element));
- }
-
- private Object[] getListElements(Object element) {
- return filter(fListViewer.getFilters(), fListContentProvider.getElements(element));
- }
-
- public Set getWhiteCheckedTreeItems() {
- return new HashSet(fWhiteCheckedTreeItems);
- }
-
- private HashMap buildCheckedStateStore() {
- return new HashMap(9);
- }
-
- private void handleUpdateSelection(Map items) {
- Iterator keyIterator= items.keySet().iterator();
-
- //Update the store before the hierarchy to prevent updating parents before all of the children are done
- while (keyIterator.hasNext()) {
- Object key= keyIterator.next();
- //Replace the items in the checked state store with those from the supplied items
- List selections= (List) items.get(key);
- if (selections.size() == 0)
- //If it is empty remove it from the list
- fCheckedStateStore.remove(key);
- else {
- fCheckedStateStore.put(key, selections);
- // proceed up the tree element hierarchy
- Object parent= fTreeContentProvider.getParent(key);
- if (parent != null) {
- addToHierarchyToCheckedStore(parent);
- }
- }
- }
-
- //Now update hierarchies
- keyIterator= items.keySet().iterator();
-
- while (keyIterator.hasNext()) {
- Object key= keyIterator.next();
- updateHierarchy(key);
- if (fCurrentTreeSelection != null && fCurrentTreeSelection.equals(key)) {
- fListViewer.setAllChecked(false);
- fListViewer.setCheckedElements(((List) items.get(key)).toArray());
- }
- }
- }
-
- /**
- * Checks if an element is grey checked.
- * @param object
- * @return if an element is grey checked.
- */
- public boolean isTreeItemGreyChecked(Object object) {
- return fTreeViewer.getGrayed(object);
- }
-
- /**
- * For a given element, expand its chidren to a level.
- * @param object
- * @param level
- */
- public void expandTreeToLevel(Object object, int level) {
- fTreeViewer.expandToLevel(object, level);
- }
- /**
- * @param selection
- */
- public void setTreeSelection(ISelection selection) {
- fTreeViewer.setSelection(selection);
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java
deleted file mode 100644
index c384630021..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java
+++ /dev/null
@@ -1,204 +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.ui.internal.wizards.schemagen;
-
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.CONTAINER_PATH;
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.FILE_NAME;
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.PROJECT;
-import static org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen.SchemaGeneratorWizard.XSD_EXTENSION;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.utility.internal.FileTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * NewSchemaFileWizardPage
- */
-public class NewSchemaFileWizardPage extends WizardNewFileCreationPage {
-
- protected IDataModel dataModel;
-
- private IStructuredSelection initialSelection;
-
- static public String DEFAULT_SCHEMA_NAME = "NewXMLSchema" + XSD_EXTENSION; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public NewSchemaFileWizardPage(String pageName, IStructuredSelection selection, IDataModel dataModel,
- String title, String description) {
-
- super(pageName, selection);
- this.initialSelection = selection;
-
- this.init(dataModel);
- this.setTitle(title);
- this.setDescription(description);
- }
-
- protected void init(IDataModel dataModel) {
- this.dataModel = dataModel;
-
- IProject project = this.getProjectFromInitialSelection();
- this.dataModel.setProperty(PROJECT, project);
-
- IPath containerPath = (IPath) this.dataModel.getProperty(CONTAINER_PATH);
- if (containerPath != null) {
- this.setContainerFullPath(containerPath);
- }
- }
-
- // ********** IDialogPage implementation **********
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
-
- this.setAllowExistingResources(true);
- this.setFileName(DEFAULT_SCHEMA_NAME);
- }
-
- // ********** intra-wizard methods **********
-
- public IProject getProject() {
- return (IProject) this.dataModel.getProperty(PROJECT);
- }
-
- public IPath getFilePath() {
- return this.getContainerFullPath();
- }
-
- // ********** validation **********
-
- @Override
- protected boolean validatePage() {
- this.dataModel.setProperty(PROJECT, this.getProjectNamed(this.getContainerName()));
- this.dataModel.setProperty(CONTAINER_PATH, this.getContainerFullPath());
- this.dataModel.setProperty(FILE_NAME, this.getFileName());
-
- boolean valid = super.validatePage();
- if( ! valid) {
- return valid;
- }
- this.overrideFileExistsWarning();
-
- //TODO move this validation to the dataModel - see MappingFileNewFileWizardPage
- // Validate Project
- valid = this.projectIsJavaProject(this.getProject());
- if( ! valid) {
- this.setErrorMessage(JptJaxbUiMessages.NewSchemaFileWizardPage_errorNotJavaProject);
- return valid;
- }
- // Validate XSD file not exists.
- valid = this.xsdFileNotExists();
- if( ! valid) {
- this.setMessage(JptJaxbUiMessages.NewSchemaFileWizardPage_overwriteExistingSchemas, IMessageProvider.WARNING);
- return true;
- }
- this.setErrorMessage(null);
-
- return valid;
- }
-
- // ********** internal methods **********
-
- private boolean projectIsJavaProject(IProject project) {
- try {
- return (project != null) && (project.hasNature(JavaCore.NATURE_ID));
- }
- catch (CoreException e) {
- return false;
- }
- }
-
- private IProject getProjectFromInitialSelection() {
- Object firstElement = initialSelection.getFirstElement();
- if(firstElement instanceof IProject) {
- return (IProject)firstElement;
- }
- else if(firstElement instanceof IResource) {
- return ((IResource) firstElement).getProject();
- }
- else if(firstElement instanceof IJavaElement) {
- return ((IJavaElement)firstElement).getJavaProject().getProject();
- }
- return null;
- }
-
- private IProject getProjectNamed(String projectName) {
- if(StringTools.stringIsEmpty(projectName)) {
- return null;
- }
- return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- }
-
- private String getContainerName() {
- IPath containerPath = this.getContainerFullPath();
- if(containerPath == null) {
- return null;
- }
- String containerName = containerPath.segment(0);
- return containerName;
- }
-
- private void overrideFileExistsWarning() {
- String existsString= IDEWorkbenchMessages.ResourceGroup_nameExists;
- existsString.toString();
-
- existsString = existsString.substring("''{0}''".length(), existsString.length()); //$NON-NLS-1$
- String message = this.getMessage();
- if(message != null && message.endsWith(existsString)) {
- this.setMessage(null);
- }
- }
-
- private boolean xsdFileNotExists() {
-
- return ! this.xsdFileExists(this.getContainerAbsolutePath().toFile());
- }
-
- private boolean xsdFileExists(File directory) {
-
- if(directory.listFiles() == null) {
- throw new RuntimeException("Could not find directory: " + directory); //$NON-NLS-1$
- }
- for(File file : directory.listFiles()) {
- if (file.isDirectory()) {
- continue;
- }
- else if(XSD_EXTENSION.equalsIgnoreCase(FileTools.extension(file))) {
- return true;
- }
- }
- return false;
- }
-
- private IPath getContainerAbsolutePath() {
- IPath projectRelativePath = this.getContainerFullPath().makeRelativeTo(this.getProject().getFullPath());
- IResource directory = (projectRelativePath.isEmpty()) ?
- this.getProject() :
- this.getProject().getFile(projectRelativePath);
- return directory.getLocation();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
deleted file mode 100644
index 977d6d809a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
+++ /dev/null
@@ -1,267 +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.ui.internal.wizards.schemagen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-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.JavaCore;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.FileTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.gen.SchemaGenerator;
-import org.eclipse.jpt.jaxb.core.internal.operations.SchemaFileCreationDataModelProvider;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * SchemaGeneratorWizard
- */
-public class SchemaGeneratorWizard extends Wizard implements INewWizard
-{
- protected IStructuredSelection initialSelection;
- private IJavaProject targetProject;
-
- protected IDataModel dataModel;
-
- private NewSchemaFileWizardPage newSchemaFileWizardPage;
-
- private SchemaGeneratorWizardPage schemaGenWizardPage;
-
- public static final String XSD_EXTENSION = ".xsd"; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public SchemaGeneratorWizard() {
- super();
- setWindowTitle(JptJaxbUiMessages.SchemaGeneratorWizard_title);
- setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.SCHEMA_GEN_WIZ_BANNER));
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.initialSelection = selection;
-
- if (selection == null || selection.isEmpty()) {
- return;
- }
- this.targetProject = this.getProjectFromInitialSelection();
- this.dataModel = null;
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- this.newSchemaFileWizardPage = this.buildNewSchemaFileWizardPage(this.initialSelection);
- this.addPage(this.newSchemaFileWizardPage);
-
- this.schemaGenWizardPage = this.buildSchemaGeneratorWizardPage(this.buildSelection(this.getProject()));
- this.addPage(this.schemaGenWizardPage);
- }
-
- @Override
- public boolean performFinish() {
-
- this.targetProject = this.getJavaProject();
-
- String[] sourceClassNames = this.buildSourceClassNames(this.getAllCheckedItems());
-
- WorkspaceJob genSchemaJob = new GenerateSchemaJob(
- this.targetProject,
- sourceClassNames,
- this.getTargetSchema(),
- this.usesMoxy());
- genSchemaJob.schedule();
-
- return true;
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- return this.getJavaProjectFrom(this.getProject());
- }
-
- // ********** internal methods **********
-
- private IProject getProject() {
- return this.newSchemaFileWizardPage.getProject();
- }
-
- private IJavaProject getProjectFromInitialSelection() {
- IJavaProject project = null;
-
- Object firstElement = this.initialSelection.getFirstElement();
- if(firstElement instanceof IJavaElement) {
- IJavaElement javaElement = (IJavaElement)firstElement;
- int type = javaElement.getElementType();
- if(type == IJavaElement.JAVA_PROJECT) {
- project = (IJavaProject)javaElement;
- }
- else if(type == IJavaElement.PACKAGE_FRAGMENT) {
- project = ((IPackageFragment)javaElement).getJavaProject();
- }
- }
- return project;
- }
-
- private IJavaProject getJavaProjectFrom(IProject project) {
- IJavaProject javaProject = (IJavaProject)((IJavaElement)((IAdaptable)project).getAdapter(IJavaElement.class));
- if(javaProject == null) {
- throw new RuntimeException("Not a Java Project"); //$NON-NLS-1$
- }
- return javaProject;
- }
-
- private String getTargetSchema() {
-
- IPath filePath = this.newSchemaFileWizardPage.getFilePath();
- String fileName = this.newSchemaFileWizardPage.getFileName();
- String targetSchema = filePath.toOSString() + File.separator + fileName;
- if ( ! FileTools.extension(targetSchema).equalsIgnoreCase(XSD_EXTENSION)) {
- targetSchema += XSD_EXTENSION;
- }
-
- return this.makeRelativeToProjectPath(targetSchema);
- }
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(this.targetProject.getProject().getLocation());
- return relativePath.removeFirstSegments(1).toOSString();
- }
-
- private Object[] getAllCheckedItems() {
- return this.schemaGenWizardPage.getAllCheckedItems();
- }
-
- private String[] buildSourceClassNames(Object[] checkedElements) {
-
- ArrayList<String> classNames = new ArrayList<String>();
-
- for(Object element: checkedElements) {
- IJavaElement javaElement = (IJavaElement)element;
- String packageName = javaElement.getParent().getElementName();
- String elementName = javaElement.getElementName();
- String className = FileTools.stripExtension(elementName);
- if(StringTools.stringIsEmpty(packageName)) {
- classNames.add(className);
- }
- else {
- classNames.add(packageName + '.' + className);
- }
- }
-
- return ArrayTools.array(classNames, new String[0]);
- }
-
- private boolean usesMoxy() {
- return this.schemaGenWizardPage.usesMoxy();
- }
-
- protected NewSchemaFileWizardPage buildNewSchemaFileWizardPage(IStructuredSelection selection) {
- return new NewSchemaFileWizardPage(
- "Page_1", selection, this.getDataModel(), //$NON-NLS-1$
- JptJaxbUiMessages.SchemaGeneratorProjectWizardPage_title,
- JptJaxbUiMessages.SchemaGeneratorProjectWizardPage_desc);
- }
-
- protected SchemaGeneratorWizardPage buildSchemaGeneratorWizardPage(IStructuredSelection selection) {
- return new SchemaGeneratorWizardPage(selection);
- }
-
- private IStructuredSelection buildSelection(IProject project) {
-
- List<IAdaptable> selectedElements = new ArrayList<IAdaptable>(1);
- this.addProjectTo(selectedElements, project);
- return new StructuredSelection(selectedElements);
- }
-
- private void addProjectTo(List<IAdaptable> selectedElements, IProject project) {
- try {
- if(project != null && project.hasNature(JavaCore.NATURE_ID))
- selectedElements.add(JavaCore.create(project));
- }
- catch(CoreException ex) {
- // ignore selected element
- }
- }
-
- protected IDataModel getDataModel() {
- if (this.dataModel == null) {
- this.dataModel = DataModelFactory.createDataModel(getDefaultProvider());
- }
- return this.dataModel;
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new SchemaFileCreationDataModelProvider();
- }
-
- // ********** generate schema job **********
-
- static class GenerateSchemaJob extends WorkspaceJob {
- private final IJavaProject javaProject;
- private final String[] sourceClassNames;
- private final String targetSchema;
- private final boolean useMoxy;
-
- GenerateSchemaJob(IJavaProject project, String[] sourceClassNames, String targetSchema, boolean useMoxy) {
- super(JptJaxbUiMessages.SchemaGeneratorWizard_generatingSchema);
-
- this.javaProject = project ;
- this.sourceClassNames = sourceClassNames;
- this.targetSchema = targetSchema;
- this.useMoxy = useMoxy;
-
- this.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(this.javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, NLS.bind(JptJaxbUiMessages.SchemaGeneratorWizard_generateSchemaTask, this.targetSchema), 1);
- try {
- SchemaGenerator.generate(this.javaProject, this.targetSchema, this.sourceClassNames, this.useMoxy, sm.newChild(1));
- }
- catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java
deleted file mode 100644
index 70aa054611..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java
+++ /dev/null
@@ -1,439 +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.ui.internal.wizards.schemagen;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.ui.JavaElementComparator;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.ProblemsLabelDecorator;
-import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.DecoratingLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jaxb.core.internal.gen.SchemaGenerator;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.filters.ContainerFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.EmptyInnerPackageFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.NonArchiveOrExternalElementFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.NonContainerFilter;
-import org.eclipse.jpt.jaxb.ui.internal.filters.NonJavaElementFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-import org.osgi.framework.Bundle;
-
-/**
- * SchemaGeneratorWizardPage
- */
-public class SchemaGeneratorWizardPage extends AbstractJarDestinationWizardPage {
-
- private IJavaProject targetProject;
-
- // widgets
- private SettingsGroup settingsGroup;
- private NonContainerFilter projectFilter;
-
- private Button usesMoxyCheckBox;
- private boolean usesMoxy;
-
- static public String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.ui"; //$NON-NLS-1$
-
- // other constants
- private static final int SIZING_SELECTION_WIDGET_WIDTH = 480;
- private static final int SIZING_SELECTION_WIDGET_HEIGHT = 150;
-
- public static final String HELP_CONTEXT_ID = "org.eclipse.jpt.ui.wizard_jaxbschema_classes"; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public SchemaGeneratorWizardPage(IStructuredSelection selection) {
- super("JAXB Schema Generator", selection, null); //$NON-NLS-1$
-
- this.setUsesMoxy(false);
- this.setTitle(JptJaxbUiMessages.SchemaGeneratorWizardPage_title);
- this.setDescription(JptJaxbUiMessages.SchemaGeneratorWizardPage_desc);
- }
-
- // ********** IDialogPage implementation **********
- @Override
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- if(visible) {
- this.updateTargetProject();
- this.updateInputGroupTreeFilter();
-
- // default usesMoxy to true only when JPT EclipseLink bundle exists and MOXy is on the classpath
- this.updateUsesMoxy(this.jptEclipseLinkBundleExists() && this.moxyIsOnClasspath());
-
- // checkbox visible only if jpt.eclipselink.ui plugin is available
- // and EclipseLink MOXy is not on the classpath
- this.usesMoxyCheckBox.setVisible(this.jptEclipseLinkBundleExists() && ! this.moxyIsOnClasspath());
-
- this.validateProjectClasspath();
- }
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
- boolean complete = this.validateSourceGroup();
- if(complete) {
- this.validateProjectClasspath();
- }
- return complete;
- }
-
- @Override
- public void setPreviousPage(IWizardPage page) {
- super.setPreviousPage(page);
- if(this.getControl() != null)
- this.updatePageCompletion();
- }
-
- // ********** intra-wizard methods **********
-
- protected Object[] getAllCheckedItems() {
- return ArrayTools.array(this.getInputGroup().getAllCheckedListItems());
- }
-
- protected boolean usesMoxy() {
- return this.usesMoxy;
- }
-
- // ********** validation **********
-
- @Override
- @SuppressWarnings("restriction")
- protected void updatePageCompletion() {
- super.updatePageCompletion();
- }
-
- @Override
- protected boolean validateDestinationGroup() {
- // do nothing
- return true;
- }
-
- @Override
- protected boolean validateSourceGroup() {
- if(this.getAllCheckedItems().length == 0) {
- if(this.getErrorMessage() == null) {
- this.setErrorMessage(JptJaxbUiMessages.SchemaGeneratorWizardPage_errorNoPackage);
- }
- return false;
- }
- this.setErrorMessage(null);
- return true;
- }
-
- private void validateProjectClasspath() {
- if(this.targetProject == null) { // project selected available yet
- return;
- }
- //this line will suppress the "default package" warning (which doesn't really apply here
- //as the JAXB gen uses an org.example.schemaName package by default) and will clear the classpath warnings when necessary
- setMessage(null);
-
- if( ! this.genericJaxbIsOnClasspath()) {
- this.displayWarning(JptJaxbUiMessages.SchemaGeneratorWizardPage_jaxbLibrariesNotAvailable);
- }
- else if(this.usesMoxy() && ! this.moxyIsOnClasspath()) {
- //this message is being truncated by the wizard width in some cases
- this.displayWarning(JptJaxbUiMessages.SchemaGeneratorWizardPage_moxyLibrariesNotAvailable);
- }
-
- //this code will intelligently remove our classpath warnings when they are present but no longer apply (as an alternative
- //to setting the message to null continuously as is currently done)
-// else if( this.getMessage() != null){
-// if (this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_jaxbLibrariesNotAvailable) ||
-// this.getMessage().equals(JptJaxbUiMessages.ClassesGeneratorWizardPage_moxyLibrariesNotAvailable)) {
-// setMessage(null);
-// }
-// }
- }
-
- /**
- * Test if the Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbIsOnClasspath() {
- try {
- String className = SchemaGenerator.JAXB_GENERIC_SCHEMA_GEN_CLASS;
- IType genClass = this.targetProject.findType(className);
- return (genClass != null);
- }
- catch(JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** internal methods **********
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, HELP_CONTEXT_ID);
-
- this.settingsGroup = new SettingsGroup(composite);
-
- this.usesMoxyCheckBox = this.buildUsesMoxyCheckBox(composite);
-
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- private void updateTargetProject() {
-
- this.targetProject = ((SchemaGeneratorWizard)this.getWizard()).getJavaProject();
- }
-
- private void updateInputGroupTreeFilter() {
- this.getInputGroup().setAllSelections(false);
-
- if(this.projectFilter != null) {
- this.getInputGroup().removeTreeFilter(this.projectFilter);
- }
- this.projectFilter = new NonContainerFilter(this.targetProject.getProject().getName());
- this.getInputGroup().addTreeFilter(this.projectFilter);
- }
-
- private boolean jptEclipseLinkBundleExists() {
- return (this.getJptEclipseLinkBundle() != null);
- }
-
- private Bundle getJptEclipseLinkBundle() {
- return Platform.getBundle(JPT_ECLIPSELINK_UI_PLUGIN_ID); // Cannot reference directly EL plugin.
- }
-
- private void setUsesMoxy(boolean usesMoxy){
- this.usesMoxy = usesMoxy;
- }
-
- private void updateUsesMoxy(boolean usesMoxy){
- this.setUsesMoxy(usesMoxy);
- this.usesMoxyCheckBox.setSelection(this.usesMoxy());
- this.validateProjectClasspath();
- }
-
- /**
- * Test if the EclipseLink Jaxb compiler is on the classpath.
- */
- private boolean moxyIsOnClasspath() {
- try {
- String className = SchemaGenerator.JAXB_ECLIPSELINK_SCHEMA_GEN_CLASS;
- IType genClass = this.targetProject.findType(className);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void displayWarning(String message) {
- this.setMessage(message, WARNING);
- }
-
- private CheckboxTreeAndListGroup getInputGroup() {
- return this.settingsGroup.inputGroup;
- }
-
- // ********** overrides **********
- /**
- * Returns an iterator over this page's collection of currently-specified
- * elements to be exported. This is the primary element selection facility
- * accessor for subclasses.
- *
- * @return an iterator over the collection of elements currently selected for export
- */
- @Override
- protected Iterator<?> getSelectedResourcesIterator() {
- return this.getInputGroup().getAllCheckedListItems();
- }
-
- @Override
- protected void update() {
- this.updatePageCompletion();
- }
-
- @Override
- public final void saveWidgetValues() {
- // do nothing
- }
-
- @Override
- protected void internalSaveWidgetValues() {
- // do nothing
- }
-
- @Override
- protected void restoreWidgetValues() {
- // do nothing
- }
-
-
- @Override
- protected void initializeJarPackage() {
- // do nothing
- }
-
- @Override
- protected void giveFocusToDestination() {
- // do nothing
- }
-
- // ********** UI components **********
-
- private Button buildUsesMoxyCheckBox(Composite parent) {
-
- Button checkBox = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.verticalIndent = 10;
- checkBox.setLayoutData(gridData);
- checkBox.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_usesMoxyImplementation);
- checkBox.setSelection(this.usesMoxy());
- checkBox.addSelectionListener(this.buildUsesMoxySelectionListener());
-
- return checkBox;
- }
-
- private SelectionListener buildUsesMoxySelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
-
- public void widgetSelected(SelectionEvent event) {
- updateUsesMoxy(usesMoxyCheckBox.getSelection());
- validateProjectClasspath();
- }
- };
- }
-
- // ********** SettingsGroup class **********
-
- private class SettingsGroup {
-
- private CheckboxTreeAndListGroup inputGroup;
-
- // ********** constructor **********
-
- private SettingsGroup(Composite parent) {
- super();
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- buildSchemaComposite(composite);
-
- // Input Tree
- createPlainLabel(composite, JptJaxbUiMessages.SchemaGeneratorWizardPage_packages);
- this.inputGroup = this.createInputGroup(composite);
-
- }
-
- protected void buildSchemaComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout(3, false); // false = do not make columns equal width
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginBottom = 10;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- }
-
- // ********** UI components **********
-
- /**
- * Creates the checkbox tree and list for selecting resources.
- *
- * @param parent the parent control
- */
- protected CheckboxTreeAndListGroup createInputGroup(Composite parent) {
- CheckboxTreeAndListGroup checkboxTreeGroup;
-
- int labelFlags = JavaElementLabelProvider.SHOW_BASICS
- | JavaElementLabelProvider.SHOW_OVERLAY_ICONS
- | JavaElementLabelProvider.SHOW_SMALL_ICONS;
- ITreeContentProvider treeContentProvider=
- new StandardJavaElementContentProvider() {
- @Override
- public boolean hasChildren(Object element) {
- // prevent the + from being shown in front of packages
- return !(element instanceof IPackageFragment) && super.hasChildren(element);
- }
- };
- final DecoratingLabelProvider provider = new DecoratingLabelProvider(new JavaElementLabelProvider(labelFlags), new ProblemsLabelDecorator(null));
- checkboxTreeGroup = new CheckboxTreeAndListGroup(
- parent,
- JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()),
- treeContentProvider,
- provider,
- new StandardJavaElementContentProvider(),
- provider,
- SWT.NONE,
- SIZING_SELECTION_WIDGET_WIDTH,
- SIZING_SELECTION_WIDGET_HEIGHT);
- checkboxTreeGroup.addTreeFilter(new EmptyInnerPackageFilter());
- checkboxTreeGroup.setTreeComparator(new JavaElementComparator());
- checkboxTreeGroup.setListComparator(new JavaElementComparator());
-
- checkboxTreeGroup.addTreeFilter(new NonJavaElementFilter());
- checkboxTreeGroup.addTreeFilter(new NonArchiveOrExternalElementFilter());
-
- checkboxTreeGroup.addListFilter(new ContainerFilter());
- checkboxTreeGroup.addListFilter(new NonJavaElementFilter());
-
- checkboxTreeGroup.getTree().addListener(SWT.MouseUp, SchemaGeneratorWizardPage.this);
- checkboxTreeGroup.getTable().addListener(SWT.MouseUp, SchemaGeneratorWizardPage.this);
-
- ICheckStateListener listener = new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- update();
- }
- };
-
- checkboxTreeGroup.addCheckStateListener(listener);
- return checkboxTreeGroup;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java
deleted file mode 100644
index 2db5a2e7aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/navigator/JaxbNavigatorUi.java
+++ /dev/null
@@ -1,40 +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.ui.navigator;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.common.ui.jface.TreeItemContentProviderFactory;
-
-/**
- * Defines content and label provider factories for Project Navigator view for a given JAXB project.
- * <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 JaxbNavigatorUi {
-
- /**
- * Return the factory to create {@link TreeItemContentProvider}s
- */
- TreeItemContentProviderFactory getTreeItemContentProviderFactory();
-
- /**
- * Return the factory to create {@link ItemLabelProvider}s
- */
- ItemLabelProviderFactory getItemLabelProviderFactory();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java
deleted file mode 100644
index e50e9ee980..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUi.java
+++ /dev/null
@@ -1,40 +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.ui.platform;
-
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-
-/**
- * This interface is to be implemented by a JAXB implementation vendor to provide extensions
- * to JAXB UI functionality.
- * <p>
- * Any implementation should be <i>stateless</i> in nature.
- * <p>
- * See the extension point: org.eclipse.jpt.jaxb.ui.jaxbPlatforms
- * <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 JaxbPlatformUi {
-
- // ********** navigator UI **********
-
- /**
- * Return the {@link JaxbNavigatorUi} for this platform,
- * which determines Project Explorer content
- */
- JaxbNavigatorUi getNavigatorUi();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
deleted file mode 100644
index 1f04ed438d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/platform/JaxbPlatformUiManager.java
+++ /dev/null
@@ -1,35 +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.ui.platform;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-
-/**
- * Repository for {@link JaxbPlatformUi}s
- * <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
- * @see JptJaxbUiPlugin#getJaxbPlatformUiManager()
- */
-public interface JaxbPlatformUiManager {
-
- /**
- * Return the platform UI responsible for providing UI elements for the given
- * JAXB platform description
- */
- public JaxbPlatformUi getJaxbPlatformUi(JaxbPlatformDescription platformDesc);
-}

Back to the top